Checks whether the given path exists or is creatable.

    This function is guaranteed to _never_ raise exceptions.

    Returns
    -------
    `True` if the passed pathname is a valid pathname for the current OS _and_
    either currently exists or is hypothetically creatable; `False` otherwise.

def path_exists_or_creatable(pathname: str) -> bool:
    """Checks whether the given path exists or is creatable.

    This function is guaranteed to _never_ raise exceptions.

    Returns
    -------
    `True` if the passed pathname is a valid pathname for the current OS _and_
    either currently exists or is hypothetically creatable; `False` otherwise.
    """
    try:
        # To prevent "os" module calls from raising undesirable exceptions on
        # invalid pathnames, is_pathname_valid() is explicitly called first.
        return is_pathname_valid(pathname) and (
            os.path.exists(pathname) or is_path_creatable(pathname))
    # Report failure on non-fatal filesystem complaints (e.g., connection
    # timeouts, permissions issues) implying this path to be inaccessible. All
    # other exceptions are unrelated fatal issues and should not be caught
    # here.
    except OSError:
        return False