there is already a solution for that: numpy.ctypeslib posted something on this regard in the previous thread:
I’ve used the ctypeslib for crunching big arrays and saw basically the same cpu time running the shared library called from python compared to a compiled executable.