Iterate over custom properties without searching?
It is correct that accessing values by key using .get() on bpy.types.struct iterates through the elements. The function that gets called through the Python API is pyrna_struct_get() (bpy_rna.c). It uses IDP_GetPropertyFromGroup() (idprop.c) which in turn calls BLI_findstring(listbase.c). As the name already suggests it performs string comparisons by iterating through a list.

It should be avoided iterating over the keys and then accessing the values, both in Blender and also Python software that uses actual dictionaries as data structure. As batFINGER suggested you could use a.items() instead.

for key, value in a.items():
    # do something with either key or value
    pass