REF: move convert_scalar out of cython
There's nothing about this that particularly benefits from being in cython (I think until recently this was used within index.pyx) and its clearer in python.  Plus we get a slightly smaller/faster build.