Hi,
We've several callers to load_external_function() that do not use the
returned value as a PGFunction. I'd vote for changing the return type to
void * and have fmgr.c cast it to PGFunction after verifying the
function's magic.
Greetings,
Andres Freund