You can write a custom templatetag and register it.
You can take some inspiration from the django load templatetag.

The problem is, would you would also have to wrap all the "loaded" templatetags in ifs. One way around it would be to register dummy functions that do nothing (maybe just log something but fail silently) so that the code just works, or even better, create an extra if_module_loaded "module" and skips the code inside. Depends on your use case.