For multi-phase initialization and sub-interpreters it would be useful to have an access to module state https://docs.python.org/3.9/c-api/module.html#c.PyModule_GetState It also requires some memory safety workaround and deallocation functions defined.