As suggested, I'm filing this in a new bug report for wider review. The updated patch attached. The previous discussion was in bug#64735, and the benchmarks (which more or less hold for the new patch as well) can be viewed here (last table): https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64735#506. Except the new version somehow performs a little better at read-process-output-max=4096 as well, despite seemingly doing more. Let me know if I DRYed this too much, or if there are better names for the extracted common routines, or etc. Or for the new variable (read-process-output-fast).