So if you have a function added through add_function_constant in some class Foo (i.e. not a module), then you can call it using Foo.my_function without ever instantiating Foo? In that case: Cool, I didn't know that worked.
Anyway, when you add the function you should know its (complete) name, right? So all you need to do is to insert it into a reverse mapping too. I think the block_alloc.h PTR_HASH_ALLOC_FILL_PAGES macro would generate a suitable hash table for this.