Due to the new const_defined? checks, passing certain names (such as
those that start with a digit) that are illegal constant names will
raise NameError. Catch this and error out gracefully, as we would have
previously.
Fixes#14342.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>