def rle_encode(s: bytes) -> bytes:
    """Zero-value RLE encoder

    Parameters:
        s (``bytes``):
            Bytes to encode

    Returns:
        ``bytes``: The encoded bytes
    """
    r = b""
    n = 0

    for b in s:
        if b == 0:
            n += 1
        else:
            if n > 0:
                r += bytes([0, n])
                n = 0

            r += bytes([b])

    if n > 0:
        r += bytes([0, n])

    return r