I'm well aware of this problem, unfortunately. See #14750, which this issue is likely a duplicate of. My attempt at fixing this without incurring a performance or memory cost is https://go-review.googlesource.com/c/go/+/224079, which has been stuck in review limbo for a little while :)
At the core of this problem is whether we want to favor a streaming decode or whether we want to buffer all the members of a JSON object in order to perform an exact match. The former has significantly better performance, while the latter probably matches user expectation better.