dlmopencan provide a custom namespace.
fdlopenif available can at least load from a file descriptor instead of requiring the library to have a path on a file system, so someone here used it to read from a memory-backed file, and there's a proof of concept project to demonstrate that the file burden is (as expected) entirely a historical choice.
Cmodules, still, it’s easy to build firmware and easy to reload it. You barely need to change
Cmodules at all to be honest. On my daily test unit I have 35
Cmodules enabled and I still get more than 32K free ram on latest dev. Firmware compile / chip erase / firmware write / LFS load / init.lua is a one-liner bash script.