import codecs


def bom_strip(content: str, strip=True) -> str:
    """Remove the UTF-8 BOM marker from the beginning of a string.

    Args:
        content: string to remove BOM marker from if found
        strip: remove whitespace before & after removing BOM marker
    """
    if strip:
        content = content.strip()
    if content.startswith(codecs.BOM_UTF8.decode()):
        content = content[1:]
    if strip:
        content = content.strip()
    return content