Fix signature of compile_function
Register compiling function in function cache if backed up by a Python function