When doing module = types.ModuleType('mymodule'), we don't get any chance of doing further customization, and we can't override module.__dict__ since it's readonly...
The same seems to apply with all other importlib functions (module_from_spec alike)
Is there a way of doing it which is not too much dirty (like... sub-classing ModuleType, and creating a temporary module and copying the fields...) ?