The partial inlining optimization for short strings could allocate strings at __min_cap size. Code in __grow_by assumed cap != __min_cap - 1 as proof that the input is an allocated long string leading to bad deallocation.
- add the invariant that no long string should have <= min_cap capacity
- use actual __is_long() for '__was_long' observation in __grow_byt logic
Combined these defend against both the (previously not expressed) invariant and its consequences.