Quoting a comment from Richard Purdie (https://lists.yoctoproject.org/g/docs/message/2100): "The reference in cache.py is poor coding and we should really try and remove that. Regardless, TMPDIR is not an bitbake variable."
Goes back to pre 2006: http://git.yoctoproject.org/cgit.cgi/poky/commit/bitbake/lib/bb/cache.py?id=27dba1e6247ae48349aee1bce141a9eefaafaad1
Patch out for testing which drops this (and the surrounding code)
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=f07a097213477c4e4291e6dbcddd04300631f294