Here's what I am going to do:
I am going to revert those 2 offending commits on the release/4.0.2.x branch, and release 4.0.2.1+hotfix1 for Windows with them reverted. I will mark them as fixing this bug.
(There has been and will be no 4.0.2.1 for Windows because of this bug.)
For the main branch (4.0.3.0-preview), I will clone this bug, and will not revert those 2 commits. We will figure out how to fix the bug without fixing these 2 commits, which are very useful. I've spent a bunch of time but cannot figure out how to do so.