I need to link my C++ programs against a couple shared libraries which generate way too much output to std::cout and std::cerr rendering them both
Three ideas (none of which I really like ...):
You can change the buffer cout/cerr are writing to by using rdbuf(). You could do this everytime just before you're calling a function in the library and resetting it afterwards (maybe using wrapper functions).
You could change the buffer permanently and use different cout/cerr objects for your own application.
You could use modified standard header files for compiling the libraries. They could define new global stream objects cout_new and use macros to redefine cout to cout_new. You could just tell the compiler to use new new version of the header files just for compiling the libraries (so you don't have to modify their source code).
As I said, none of these solutions is "clean", but you asked for it :) ...