The spec appears to make no guarantees about the order of the keys being added to the returned object. Doesn't this mean that iterating that object will give different outputs each time depending on insertion order? Additionally, doesn't this mean different object shapes as far as JIT inline cache is concerned?
The keys will be in insertion order. To get a stable output order that may increase the probability of a consistent hidden shape you would need to sort the iterable the group is being produced from so the keys are seen in the same order.
That said. The shape could still change when different iterables produce different sets of keys.