The [`os.path` docs intro](https://docs.python.org/3/library/os.path.html) includes:

> Note: Since different operating systems have different path name conventions, there are several versions of this module in the standard library. The `os.path` module is always the path module suitable for the operating system Python is running on, and therefore usable for local paths. However, you can also import and use the individual modules if you want to manipulate a path that is *always* in one of the different formats. They all have the same interface:
>
> - `posixpath` for UNIX-style paths
> - `ntpath` for Windows paths

But we don't explain that some of the functions in `ntpath` and `posixpath` aren't suitable for usage on a "foreign" OS, e.g. that using `ntpath.realpath()` from POSIX is a bad idea.

These functions are safe because they do purely lexical work:

- `basename`
- `commonpath`
- `commonprefix`
- `dirname`
- `isabs`
- `join`
- `normcase`
- `normpath`
- `split`
- `splitdrive`
- `splitroot`
- `splitext`

These functions are probably unsafe because they rely on details of the host OS (e.g. via the `os` module):

- `abspath`
- `exists`
- `lexists`
- `expanduser`
- `expandvars`
- `getatime`
- `getmtime`
- `getctime`
- `getsize`
- `isfile`
- `isdir`
- `isjunction`
- `islink`
- `ismount`
- `isdevdrive`
- `realpath`
- `relpath`
- `samefile`
- `sameopenfile`
- `samestat`
- `supports_unicode_filenames`

<!-- gh-linked-prs -->
### Linked PRs
* gh-119772
<!-- /gh-linked-prs -->

Some ntpath/posixpath functions unusable on foreign OS
This is a GitHub Issue
repo:cpython
owner:python
Title : Some ntpath/posixpath functions unusable on foreign OS
Issue date:

--- start body ---
The [`os.path` docs intro](https://docs.python.org/3/library/os.path.html) includes:

> Note: Since different operating systems have different path name conventions, there are several versions of this module in the standard library. The `os.path` module is always the path module suitable for the operating system Python is running on, and therefore usable for local paths. However, you can also import and use the individual modules if you want to manipulate a path that is *always* in one of the different formats. They all have the same interface:
>
> - `posixpath` for UNIX-style paths
> - `ntpath` for Windows paths

But we don't explain that some of the functions in `ntpath` and `posixpath` aren't suitable for usage on a "foreign" OS, e.g. that using `ntpath.realpath()` from POSIX is a bad idea.

These functions are safe because they do purely lexical work:

- `basename`
- `commonpath`
- `commonprefix`
- `dirname`
- `isabs`
- `join`
- `normcase`
- `normpath`
- `split`
- `splitdrive`
- `splitroot`
- `splitext`

These functions are probably unsafe because they rely on details of the host OS (e.g. via the `os` module):

- `abspath`
- `exists`
- `lexists`
- `expanduser`
- `expandvars`
- `getatime`
- `getmtime`
- `getctime`
- `getsize`
- `isfile`
- `isdir`
- `isjunction`
- `islink`
- `ismount`
- `isdevdrive`
- `realpath`
- `relpath`
- `samefile`
- `sameopenfile`
- `samestat`
- `supports_unicode_filenames`

<!-- gh-linked-prs -->
### Linked PRs
* gh-119772
<!-- /gh-linked-prs -->

--- end body ---
