I managed to track down the issue. I got lucky with one of the builds and got the following log output before it crashed:
If I use:
$ pip install --progress-bar off
it disables the progress bar, the maximum log length isn’t exceeded, and the build successfully completes. This is likely a bug in pip for very large downloads. I’ll see if anyone has ever reported it and submit a new issue if not.