I was thinking that maybe the solution is for fouls to be less punitive, so that referees aren't so reluctant to call them in cases where they know they should. Steve Javie's little side commentaries for TNT were very revealing. He kept talking about how referees need to "know the game situation" as part of the equation for whether to make a foul call. He made no apology whatsoever for the sliding scale of what does or does not constitute a foul: If it's a star's sixth foul, or even his fifth, you have to know that, and you have to officiate accordingly.
What if fouling out were impossible? Instead, you could have other penalties for excessive fouling: For example, after a player's sixth foul, the other team gets a technical free throw. Maybe at the eighth foul the penalty gets larger, two free throws or whatever. Excessive foulers would still be punished, but we wouldn't have these huge swings in which one bad call -- say, for example, the third foul on LeBron James early in the second quarter -- completely changes the complexion of a game.
As for referees swallowing their whistles when the game is on the line, this wouldn't help that, but it could at least be a start.