Sub-Issue from #2116363: [PP-1] Unified repository of field definitions (cache + API).
Look where that function is used, use EntityManager::getFieldDefinitions($entity_type, $bundle) instead.
If the bundle is not passed, you need to instead refactor the code to loop over the entity bundles instead. But start with the easy calls.