I am trying to reduce a particularly computational heavy piece of Python code through compiling as C with Cython. Surprisingly I have virtually no success in speeding it up