def _lstrip(text: str, chars: str) -> str:
    """
    Given a string `text`, remove the leading `chars` if and only if they
    appear as the leading characters
    """
    if chars and text[:len(chars)] == chars:
        text = text[len(chars):]
    return text