@JdeBP You're not wrong, but tbh, utmp is, has always been and will always be a hack; utmps exists because musl doesn't implement utmp (because you can't make it half-secure without a daemon, and @dalias thinks it's user spying anyway) but Adélie Linux people wanted to make 'who' work. 😅
Doing user accounting seriously would require a complete redesign of the whole thing, not only to have serious APIs instead of the barely usable utmp/x ones, but first and foremost to decide what exactly we want to log and for what purpose, and even what constitutes a user.
utmp is not the place to do it. I intend to study that domain at some point, as part of something that is long overdue: I want to take a long hard look at PAM and design something similar in a secure way, that doesn't encourage applications to share their address space with 3rd party authentication modules. And when we talk authentication, we can also talk legitimate user accounting.
The plan is to apply for an @nlnet grant to do that work, but first I need to deliver on my current one, s6-rc for Alpine 😁