To put a damper on the uncreative teamism, we need to change the election system. If we were to replace first-past-the-post with Range Voting, then it pays to be not disliked in general as much as it pays to be liked by your own faction.
(With Range Voting, voters “grade” or “rate” each candidate vs. picking a favorite. This is how judges “vote” in contest situations.)
Such a system would allow other coalitions/parties to arise than Republican or Democrat. It would not, however, allow a radical party, such as the current Greens or Libertarians, to get traction. You still have to field most liked candidates that win some districts. The resultant Congress would represent the moderate wings of many ideologies.
(And yes, this could be applied at the primary level. Donald Trump would have lost if the Republican had used Range Voting. He was the only representative of a particular faction, so he got pluralities as long as mainline Republicans were divided. But he also had the highest negatives. Many primary voters would have given him zero ratings.)