I did a quick test with python 3.12 and noticed this in pyconfig.h /* Define on FreeBSD to activate all library features */ #define __BSD_VISIBLE 1 I assume this should be #undef? At least it is in previous versions.