If you want to logout another macOS user entirely from the console, it’s sufficient to kill the
pkill -9 -u <user> loginwindow
SIGTERM, so we have to use
SIGKILL and any unsaved work may be lost. But who cares, we did it without leaving the terminal, which is much more important!
(As seen on Ask Different)