doc cleanup and some Sphinx fixes
clear global reference to module dict in module cleanup code
avoid unnecessary overhead when setting Python class docstrings
simplify C code for setting up public enums