This function accepts $load_entities as argument so returning EntityNG now #1818560: Convert taxonomy entities to the new Entity Field API or just stdObject from db_select() fetch

Proposed
Clean-up usage of taxonomy_get_tree() to return array of stdObject and separate function to load entities based on result

Comments

If we return stdclass instead of the entity, we need to change (at least) the entity reference plugin for them (TermSelection.php) that uses $term->id() for $term->tid

We'd need to change a ton of things. For example, whenever you need the term name in the correct translation, you *need* the loaded term object and call label(). That's why the load_entities argument was introduced initially.