I ran into the expand-file-name bug outside of Tramp, and fixed it by installing the attached patch into Emacs master. I hope it fixes Bug#26911 too. With luck it (or something like it) might even bear on Bug#34834 too, so I'll cc this message there. (I don't use MS-Windows or Tramp so am not good at testing in those environments.)