Don't pass static functions because of performance issues (https://github.com/HaxeFoundation/haxe/issues/3025)