python interface: only export __str__ and __repr__ if *_to_str is declared