I've just been working on this using PySide6 and looks like some things may have changed in Qt since the answer above. This is what's working for me (and thank you for the post above because it's the only one I've found that had anything like a simple answer!):
palette = self.palette()
palette.setBrush(QPalette.ColorRole.HighlightedText, QBrush(Qt.BrushStyle.NoBrush))
self.setPalette(palette)