For Python str().
Redirect std cout to a string stream so we can return a string representation of an object when it prints to cout. https://stackoverflow.com/questions/5419356/redirect-stdout-stderr-to-a-string