Alter user's entity label method
I'm not sure if there's a shortcut for that, but if not the steps are still quite minimal:


Sub-class the \Drupal\user\Entity\User class in a custom module, and override its label() method:

mymodule/src/Entity/User.php

namespace Drupal\mymodule\Entity;

use Drupal\user\Entity\User as CoreUser;

class User extends CoreUser {

  public function label() {
    return 'something new';
  }

}

Implement hook_entity_type_alter() to set the class for the User entity type:

function MYMODULE_entity_type_alter(&amp;$entity_types) {
  $entity_types['user']-&gt;setClass(\Drupal\mymodule\Entity\User::class);
}

Rebuild the cache