Some optimizations to `posixpath.realpath()` are possible - see attached PR. <!-- gh-linked-prs --> ### Linked PRs * gh-114848 * gh-117481 <!-- /gh-linked-prs -->