Why is pasting into SSH so painfully slow?

This is typically a buffer that gets filled. You can compare this to traffic on the highway, if there drive less cars than the highway is designed it goes all fine. But if there drive more cars than the limit, the traffic on the highway slows down because the highway can't handle it. The CPU simply gets higher because it's constantly emptying and filling small parts of the buffer, causing a lot more cycles. The 100ms latency can quickly add up to making it several seconds to get all the data through the buffer.

SSH is designed for executing commands, so you might want to use another way to accomplish this or try to rethink what exactly you are doing. I don't see why you should be remotely editing PHP (that doesn't make sense nowadays) or why you would copy paste a file when you can just sent it...