def METHOD_NAME(s: Any, encoding: str = 'utf-8') -> str:
    """Convert bytes to unicode if necessary."""
    tag = 'g.toUnicode'
    if isinstance(s, str):
        return s
    if not isinstance(s, bytes):
        print(f"{tag}: bad s: {s!r}")
        return ''
    b: bytes = s
    try:
        s2 = b.decode(encoding, 'strict')
    except(UnicodeDecodeError, UnicodeError):  # noqa
        s2 = b.decode(encoding, 'replace')
        print(f"{tag}: unicode error. encoding: {encoding!r}, s2:\n{s2!r}")
        trace(callers())
    except Exception:
        es_exception()
        print(f"{tag}: unexpected error! encoding: {encoding!r}, s2:\n{s2!r}")
        trace(callers())
    return s2