In Python there is a way to optimize certain things on script execution by passing the -O flag which removes docstrings from runtime, and most importantly, sets the built-in constant __debug__
to False, which makes the interpreter completely ignore the execution of assertions and any debug-specific code.
Is there any specific reason Blender’s Python interpreter always runs in debug mode without optimization enabled? That is definitely useful for addon debugging and development, but simply ignoring assertions could provide a significant performance increase for some python packages if they are used in the addon.