Add "with_out_str" function/macro

Thought this might be useful. Let me know if I should move it.