Strictly speaking the new key is still problematic.
hostname = AA
baseURL = BB
has the same key as
hostname = A
baseURL ABB
The same applies to any of the other concatenation partners.

I am not sure how much of an issue this can be in practice, but one solution to this problem is using a special character that can never be part of any of the strings that are being joined as a spacer. E.g. `$this->context->getHost() . '#' . $this->context->getBaseUrl()` or using join() or so.