Not so long ago, a lot of Republicans were itching to replace Maryland's Republican Sen. Charles McC. Mathias. They were angry that, by moving to reopen hearings, he helped torpedo the nomination of William Bradford Reynolds. They were irritated by his public willingness to consider raising taxes. They remembered that his support of Ronald Reagan in 1980 and 1984 was diffident, and that his enthusiasm for many of the president's programs has been restrained. They speculated about primary opponents: the former head of the Office of Personnel Management, Donald Devine, was mentioned; there was a flurry of interest in Jeane Kirkpatrick. A few on the right fantasized about supporting an independent such as former lieutenant governor Samuel Bogley, or even a Democrat.

You don't hear much talk of that kind anymore. The national Republican leaders who not so long ago were so dissatisfied with Mr. Mathias now seem to be busy urging him to run. The senator himself has been tantalizing friends and foes by letting his campaign committee wind down, and saying he hasn't made a decision yet.

The reason most Republicans are now urging Mr. Mathias on is that, like most politicians, they can count. Whether they like Mr. Mathias or not, they want Republicans to keep control of the Senate in 1986. That won't be easy: Republicans have more seats at risk than Democrats do, and many Republicans are on the defensive. At the beginning of the year, Republican chances seemed improved when Democrats Russell Long and Thomas Eagleton announced their retirements. But the Democrats were helped last month when Republican Paul Laxalt, against the president's urgings, announced he wouldn't run. A similar decision by Mr. Mathias would reduce Republican chances further. Prominent Democrats -- Gov. Harry Hughes, Reps. Barbara Mikulski and Michael Barnes -- are mentioned as candidates for his seat, and in Maryland, which Jimmy Carter carried twice and where Walter Mondale got 47 percent of the vote, any of them would be a favorite to win over any Republican except the incumbent.

So important has Mr. Mathias' seat become to Republicans that there are rumors that Strom Thurmond will agree to give up the Judiciary Committee chairmanship to Mr. Mathias and take Armed Services instead. Neither of these politicians is saying there is anything to those rumors. But even conservatives might decide it's better to lose one chairmanship to a sometimes anti-Reagan Republican than to risk losing all of them to Democrats.