question: is clearing Safari’s history every time I close Safari sufficient for erasing cache and cookies? Maybe not?
You shouldn't have to do that.
Something just isn't right. I understand you log into Amazon, provide your Amazon login information, and are subsequently challenged to provide their two-factor authentication code they sent to the phone number they have on file. It provides a dialog box asking for it like the one shown below:

Yet you do not receive that code, or you receive it once and never again until you clear Safari's history.
Is all of that correct? If anything is different about your experience please explain.
Then please do me a favor. Download and run EtreCheck and post its report in a reply to this Discussion.
Instructions are here: How to use the Add Text Feature When Posting Large Amounts of Text, i.e. an Etrecheck Report - Apple Community
EtreCheck is a general purpose data-gathering and -reporting tool. It does not gather or report anything of a personal nature, and can just be dragged to the Trash when you're finished with it if you want.
It may not reveal anything actionable, but for now I am willing to give Amazon the benefit of the doubt and consider the possibility of something amiss with that Mac. Let's find out what that might be.