faster implementation of Path.version_stripped