[devtools] allow non-coercible objects in formatConsoleArgumentsToSingleString (#31444)
## Summary We have been getting unhandled `TypeError: Cannot convert object to primitive value` errors in development that only occur when using devtools. I tracked it down to `console.error()` calls coming from Apollo Client where one of the arguments is an object without a prototype (created with `Object.create(null)`). This causes `formatConsoleArgumentsToSingleString()` in React's devtools to error as the function does not defend against `String()` throwing an error. My attempted fix is to introduce a `safeToString` function (naming suggestions appreciated) which expects `String()` to throw on certain object and in that case falls back to returning `[object Object]`, which is what `String({})` would return. ## How did you test this change? Added a new unit test.