In this vein, I wrote a blog post on writing your first PAM module here [0].
> each time you add an authentication mechanism
I don't do that. No one ever does that. Normal people don't keep a picturebook of authentication mechanisms that they need to cycle through. All the non-/etc/password PAM modules that some clueless IT ever forced on me (for as long as it took me to root and purge them from existence) to hook up with some network service just end up breaking your user account. The highlight is when they don't even authenticate with the network because they instead cache credentials.
[1] https://github.com/PADL/CredUI