I've only now noticed that using APE's putenv() does create an entry for the variable in /env but does not reset environ (see /sys/src/ape/lib/ap/plan9/_envsetup.c). This means that any subsequent call to getenv() for the variable you're trying to test will not actually produce your expected result unless you fork or exec a subprocess that will call _envsetup() again.
It seems a shame that putenv() would need to rebuild environ each time, but that may be the only option to a clean posixish solution for APE programs. -jas