would you be able to share links to code that is checking this?
In my experience most code is using JSON as a serialisation format, so they only care that you’ll get the same value back when parsing the JSON. Not if it needs to include escape characters to do so.
It’s not very common in everyday usage, but it can be extremely useful in critical high-traffic scenarios. JSON.stringify is relatively slower, and custom stringifiers can provide a real performance boost.
I think you’re reversing cause and effect here. The restrictive JSON stringifiers are faster because they model output on a schema (either official JSON Schema(tm) or something proprietary) and do not support the entire JSON grammar.
"Well-formed" is thus a misnomer and even the authors of those packages wouldn’t call their happy path "well-formed," it’s just simple enough for them to use all-userland code.
Like you wouldn’t call a CSV "well-formed" if it doesn’t have escaped delimiters and dquotes, would you? You might call it "simple" or "naive" though.
About performance, similar to String.prototype.isWellFormed() (docs):
isWellFormed() is more efficient, as engines can directly access the internal representation of strings.
In the same way, JSON.isWellFormed could access the internal representation of strings and thus be more efficient than using regular expressions.
eg. in V8 src/json/json-stringifier.cc - v8/v8 - Git at Google the efficiency comes from vectorized word-level scanning, with a fallback to per-character checks when needed. This is what should be exposed as JSON.isWellFormed