There is still a bounds check, do the following:

define pos0 and pos1 as normal numpy arrays (no cdef) outside of the function, then define local cdef'd views inside the function and access them here:

cdef char[:, ::1] cpos0 = pos0
cdef char[:, ::1] cpos1 = pos1