What does it mean to "clean up a path without resolving symlinks?" To me that says "I want to clean up a path, but incorrectly". What's your application for cleaning up things incorrectly? In other words, what are you working on that has you say "Which I foresee a possible problem with in the future, for what I am working on".