Tidy up the non-identifier Python literal generation.