🇩🇪Germany tte
Added the patch. As you only need to check whether there is more than one referenceable entity, you may use the getReferenceableEntities method with a limit of 2, which avoids loading all entities which are not needed in this case.
🇩🇪Germany tte
Sorry, I'm still investigating. The issue seems to be caused by https://git.drupalcode.org/project/inline_entity_form/-/blob/8.x-1.x/src...
The method countReferenceableEntities triggers the memory allocation error, as there's no limit involved when looking for referenceable entities. I've yet to find a workaround, after I thought I was on the right track. Versions of inline_entity_form prior to 8.x-1.0-rc15 are not affected.