Why is my BASH_FUNC_foobar%% environment variable unset in shell subprocesses?

I’m messing around with the security of a setuid binary (with the intention of disclosing anything I find to the author, obviously). I’m pretty sure it has an arbitrary code execution vulnerability because it invokes a shell script and it doesn’t sanitize the environment – I thought of bash’s export -f but I can’t actually make a proof of concept work.