“Actors” are largely data. The code you build with Unreal is always “in memory” even if there are currently no actors that reference the code.
If you really need to load/unload actual code, then you need to use platform-specific methods to load/unload dynamic libraries. Note that OS-es may or may not actually unmap the code, even if you call dlclose()/FreeLibrary().
My main question is why you need to “unload the code,” though. What problem are you trying to solve?