def _num_starting_hashes(line: str) -> int:
    """Return the number of hashes (#) at the beginning of the line."""
    if not line:
        return 0
    for n, char in enumerate(line, start=0):
        if char != "#":
            return n
    return len(line)