Safari does warn you about that if you click Clear History (and thanks for pointing this out; I have never done it). A quick look at OnyX
shows that that app allows you to clear History separately from other things. I don't know if that will delete logins and passwords as well, so your on your own. Use the Cleaning tab and select Internet.
OS 10.15.2, iMac Retina 5K 27-inch, late 2014, 3.5 GHz Intel Core i5, 1 TB fusion drive, 16 GB RAM, Epson SureColor P600, Photoshop CC, Lightroom CC, MS Office 365