Random programming thought:
Default core library containers could have a reference count prefixed at the front of their allocation, akin to a ref-counted smart pointer (for indirect references like Span)
If the allocation changes because data was added/removed, and the container has any references, it could then become a copy on write operation to keep the indirect references valid. Otherwise it's a normal realloc operation
And then you provide specialty types that don't behave that way
The motivation would be to make the defaults safer, but provide the means to squeeze out optimization where needed. Iterator / span / reference invalidation are common problems, and something like this could possibly resolve it in the general case
(I'm sure there are languages / libraries that do this, but search engines suck now)