Depends on what you need to do with the path. The best way, imo, is to
simply use pathlib.Path and ignore the existence of other path
representations. If input is coming from elsewhere, convert it to
pathlib.Path as early as possible. In the main body of your code, it
should be able to rely on all paths being Path objects.
--
regards,
kushal