Here's the patch again, this time with a 128kB buffer size.
This gives us nearly the same gains (~7%) for the blob INSERTs, and the additional memory usage (120kB) shouldn't really matter, with "temp_buffer"s 8MB and "work_mem" 4MB defaults.
Making it configurable would give a much more complex patch -- so I suggest just using this fixed size.