Implemented proper handling when __str__ and __repr__ are not allowed. In
those cases we do not want to fail with a cryptic error, but provide an
informative output.