FIX Handle large lengths and negative lengths in hiwire_get_length. While investigating this bug:

> ```
> Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
> The cause of the fatal error was:
> PythonError: OverflowError: Python int too large to convert to C ssize_t
> ```
> 
> _Originally posted by @amitsaha in https://github.com/pyodide/pyodide/issues/2584#issuecomment-1139530294_

I found a different one. Turns out handling lengths correctly is quite hard.
# setup: n=100 ; import numpy; db = numpy.random.randint(2, size=(n, 4), dtype='bool')
# run: check_mask(db)
# from:
# http://stackoverflow.com/questions/34500913/numba-slower-for-numpy-bitwise-and-on-boolean-arrays

# pythran export check_mask(bool[][])
import numpy as np


def check_mask(db, mask=(1, 0, 1)):
    out = np.zeros(db.shape[0], dtype=bool)
    for idx, line in enumerate(db):
        target, vector = line[0], line[1:]
        if (mask == np.bitwise_and(mask, vector)).all():
            if target == 1:
                out[idx] = 1
    return out

# setup: n=100 ; import numpy; db = numpy.random.randint(2, size=(n, 4), dtype='bool')
# run: check_mask(db)
# from:
# http://stackoverflow.com/questions/34500913/numba-slower-for-numpy-bitwise-and-on-boolean-arrays

# pythran export check_mask(bool[][])
import numpy as np


def check_mask(db, mask=(1, 0, 1)):
    out = np.zeros(db.shape[0], dtype=bool)
    for idx, line in enumerate(db):
        target, vector = line[0], line[1:]
        if (mask == np.bitwise_and(mask, vector)).all():
            if target == 1:
                out[idx] = 1
    return out
