[3.13] gh-118507 : Refactor nt._path_is* to improve applicability for other cases (GH-118755)
#119360
+453
−365