Implement PEP 412: Key-sharing dictionaries (closes #13903)

Patch from Mark Shannon.
12 files changed