Have you tried moving import statements into the functions where they are invoked? My understanding is this is effectively the same as lazy loading the module[1].
A little Python preprocessor that lets you annotate your lazy modules sounds like a fun little toy project, actually. Not something I'd use for real, but it would be fun to build.
[1] https://stackoverflow.com/questions/3095071/in-python-what-h...