Functions are hard barriers for optimization and I don't see that changing any time soon.
Which goes even so far that EXPLAIN doesn't work on them and you just get a black box of "Function call to ..." in the execution plan.
Using auto_explain is the only workaround known to me for that.