That's not difficult at all.
You can just say
env['f'] = myfunc
and the function will be available as f within the environment. env['f'] = myfunc
and the function will be available as f within the environment.