It seems that providing a buffer large enough for the data I expect to deal
with is the most reliable approach.

Couldn't you use asio::streambuf as a buffer?