I feel this should be mentioned in the user manual, as it took a relatively long time for me to give up hunting through, first the user manual, then the javadocs, trying all sorts of things, then eventually giving up and searching here to find this, which works, but it not obvious in the slightest (and I've used Ignition once or twice before)
The whole situation is unnecessarily complicated by some legacy debt.
If you have an explicitly wrapped PyUser, user.get("username") works - and all the system.user scripting functions should return PyUser objects. But if you somehow end up with something that's not a PyUser, you have to do the awkward reference thing. And it wouldn't surprise me if there are code paths that don't properly hand back a PyUser still, because we're not doing that wrapping automatically.
One thing we could/should do is add constants, now that the hinting system supports them - at least then you'll have some autocomplete for our known attributes, so
user = system.user.getUser("someuser")
username = user.get(system.user.Username)