After experimenting with Pybind11 to create C++ extensions for Python, I was hoping to write C++ sections for computationally heavy parts of my code. In my particular case, I would like to work with numpy arrays and use a mixture of numpy functions and my C++ code for speed.
I can see a way to work with numpy arrays in C++ here and have seen calls to numpy/scipy functions handled in other examples by calling the python interpreter to call the functions. For something like numpy, which is built from C code, is it possible to call the functions without calling the python interpreter and suffering the overhead, or is this the appropriate way of calling numpy functions in pybind11? If this interpreter must be called, could one use C++ multithreading (pthreads) to parallelize code called by the python interpreter, or does the code neccisarily share the same python interpreter and thus GIL?