small speedup of casting to numpy from c

by using the ctypeslib of numpy casting to numpy array is much faster
(and probably more efficient memory wise)