code: def xnormpath(path):
    
    # replace escapes and Windows slashes
    normalized = posixpath.normpath(path).replace(b'\\', b'/')
    # fold the result
    return posixpath.normpath(normalized)
docs: Cross-platform version of os.path.normpath