Avoid `Process.exec` on Windows and explicitly spawn subprocess (#17049)