It isn't totally clear from your question, but I assume that "dump" is a method in your program, not a method on a Python object in gdb.
In this case, the only way I can think of to accomplish what you want is to temporarily redirect stderr to a string (using iostreams or the libc equivalent), call the function, and then restore stderr. Finally, have gdb use the resulting string.
This is extremely roundabout. It would be simpler to change your "dump" function.
It is usually best not to have pretty-printers do inferior function calls. First, this can break or otherwise act weirdly in some scenarios (like: "break dump" and then "bt" -- probably something bad happens). Also, it prevents you from using pretty-printing with core files.