如何推迟函数调用直到模块导入?

是否可以将运行功能推迟到导入模块之前?

例如,说我有这个表达:

import multiprocessing.spawn
python_exe = search_env_for_python() # this might be slow.
multiprocessing.spawn.set_executable(python_exe)

I would like to postpone calling search_env_for_python until the multiprocessing module is imported.

有没有一种方法可以将函数调用延迟到模块导入之前?