gh-118507 : Refactor `nt._path_is*` to improve applicability for other cases (GH-118755)

(cherry picked from commit b64182550f73e556344bd754d32e3be5d22a74e1)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
6 files changed