Populate a field in form alter with user name and one with user ID
The D8 uid property reference isn't something that can be cast into a string as you could in D7.

In D7, user objects use a generic PHP object class (stdClass) with a uid property containing a string. In D8, user objects use a Drupal\user\Entity\User class. This class does't have a direct uid string property. 

In D8 the uid property magically retrieves the User entity field property instead of a simple uid string. 

As such, there are other new methods/properties (as you've mentioned) to retrieve the underlying uid value.