An alternative approach is to take additional `int *indices, int *indptr` arguments and use those to derive `issparse = (indices == NULL)`. That way, you don't need the GIL.