Can't build PyImath_d on Windows without debug Python build
On Windows pyconfig.h automatically links to debug Python builds if _DEBUG is defined: https://github.com/python/cpython/blob/v3.10.9/PC/pyconfig.h#L270-L271
Boost Python wraps this so that it can be compiled in debug mode without requiring a debug build of Python: https://github.com/boostorg/python/blob/boost-1.76.0/include/boost/python/detail/wrap_python.hpp#L23-L48
This is the default behaviour and can be controlled using BOOST_DEBUG_PYTHON.
Because PyImath headers include Python.h directly this bypasses the Boost python wrapper causing link incompatibility.
These headers should include boost/python/detail/wrap_python.hpp instead. Other libraries (e.g. USD) wrap BOOST_DEBUG_PYTHON in a cmake option, e.g.: https://github.com/PixarAnimationStudios/USD/pull/1478
This is a reasonable suggestion, we could do that. Are you interested in submitting a PR? I don't personally work with debug python builds on windows, so I'm not really set up to try this locally.