This is a trivial reproducer:
In [1]: from mpi4py import MPI
In [2]: info = MPI.Info.Create()
In [3]: info.Set('key', 'value')
In [4]: info.Get_nthkey(0)
Output:
python3: pinfo_get_nthkey.c:97: PMPI_Info_get_nthkey: Assertion `OPAL_OBJ_MAGIC_ID == ((opal_object_t *) (key))->obj_magic_id' failed.
See mpi4py testsuite failure.