See https://lore.kernel.org/all/27439f1c-a64d-41a0-815e-882a1a9a5b4d@prevas.dk/ . The problem is that the line inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} ends up doing an immediate expansion of PACKAGECONFIG, so if one tries to set PACKAGECONFIG in a .bbappend, the value used in the inherit line (i.e. the weak default set in the recipe) does include the word "python". If the final PACKAGECONFIG value set in the .bbappend file does not, the dependency machinery does not pull in python. That shouldn't be a problem, except that it is, because perf's build system behaves differently when there is a PYTHON variable in the environment (which there is, because the recipe has implicitly inherited python3native, which does 'export PYTHON'). So the build actually breaks.
Fixed with the addition of inherit_defer: https://git.yoctoproject.org/poky/commit/meta/recipes-kernel/perf?id=c917323a39da6fc3e8d92b2fe907d0357149c9bb