In addition to the other answers there is the option of just creating the function in a Python module outside Postgres and doing:
from some_module import f
Which would seem to address this(from the SO post):
"This can be done using t = plpy.execute("select f1()"), but I want, if it is possible, call it as a normal Python function to avoid type conversions (for example jsonb, etc)."
The downside being you have a dependency outside the database.