DEBUG links with other libraries built in DEBUG mode and may use the DEBUG C run-time library.
"Some C run-time functions and C++ operators behave differently when called from a debug build of an application."
https://learn.microsoft.com/en-us/cpp/c-runtime-library/debug-routines?view=msvc-170
AutoCAD and the Object ARX libraries are built in release mode, linked with the Release CRT, so you should not mix the two.
I haven't used it myself, but I believe it adds a wrapper, where DEBUG can be defined within a limited scope and will also trigger a compiler warning.
Typically, I add my own preprocessor definition to the Debug configuration, e.g., PYRXDEBUG=1. This allows you to create custom assert and logging macros.
Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx