def _remove_prefix(text: str, prefix: str):
    """
    When we drop support for python <3.9 then str.removeprefix can be used
    """
    if text.startswith(prefix):
        return text[len(prefix) :]
    return text

    When we drop support for python <3.9 then str.removeprefix can be used
    
poethepoet/task/shell.py