When calling a C function repeatedly from Python, inverting the loop to execute within C++ via FFI (e.g., using cppyy) can yield a 100x speedup compared to a Python-driven loop.
Open the full topic