Revert "Revert "If we already have funcs generated, let the pillar use them""

This reverts commit a8a9305bdf30cced48aa5af7ae38f9ef398ac1c9.
Fix breakage caused by early function loading

Fixes #17955