I'm not able to reproduce this on NetBSD or Linux. What versions of devel/py-setuptools and Python itself do you have installed?
On six or so systems: python310-3.10.2 py310-setuptools-60.9.3 On one system: python39-3.9.10 py39-setuptools-60.9.3Perhaps mk/subst.mk doesn't gracefully handle instances where the substitution isn't necessary, like where LOCALBASE is already /usr/local. It couldn't be that simple, could it?
John