No, I don’t think the ActivityPub (Mastodon-compatible) username is exposed in Hugo templates, unfortunately. It is public information, however, so, in theory, you could fetch it from the user’s profile page using resources.GetRemote and findRE.
But that is a bit of a hack and would slow down builds. Hopefully, @manton will consider exposing the ActivityPub username to Hugo templates instead.
Please don’t hesitate to mention stuff like this that is missing. Sometimes it’s on purpose but often just an oversight, like in this case of the ActivityPub username. I’ll get it added within the next couple of days. Thanks!