In #12881, #12890 it turned out that make_function_scalar_inputs_return_type may lead to less performant code.
In #12909 it turned out that make_function_inputs2 may lead to less performant code.
Revise remaining usages and improve. See above PRs for guidance.