util: custom `inspect()` method may return an Object

This is more like how `JSON.stringify()` works.
Closes #2711.