Zagor, I think what you are really looking to do is utilize a specific set of instructions (you found within a command) to be usable across all of your code. This is not a case for a command, but rather a stand-alone function. The
execute_cmd() method is just a shortcut for an object to access a set of instructions, with command specific restrictions (such as checking the permissions of an object). Restriction checks are why a command wants an object, as well as knowing who to send messages to once an action happens! (You can always search for and use objects within any function, if you need to.
https://www.evennia.com/docs/latest/api/evennia.utils.search.html#evennia.utils.search.search_object)
Now you have a foundation to work from. First off, you'll need to strip out elements that are specific to caller, which is the object executing the command. Once you've done that, you can begin to add your own custom behaviors, or just leave the functionality of it alone and use it as a generic teleport.
Now that you have your custom function in a custom module, any other module you wish to use this in must have the `my_functions.py` module imported. Such as: from world.my_functions import teleport
Now you can use teleport by itself anywhere in that module by calling: teleport(arguments)