Maryland Sen. Charles McC. Mathias, a liberal-to-moderate Republican whose political future has been the subject of wide speculation in the last year, is virtually certain to run for reelection in 1986, according to state and national GOP political leaders.

In recent weeks Mathias, who has come under attack from conservatives in the state GOP for his criticism of President Reagan's defense and economic policies, has exhibited all the signs of a candidate gearing up for reelection. He has traveled the state several times and begun speaking at political functions, including a series of Lincoln Day dinners in different counties.

"I would be very, very shocked and surprised if he didn't run," said Maryland GOP Chairman Allan C. Levey.

"All indications are that he's going," said Jim Murphy, deputy political director of the National Republican Senatorial Committee.

For his part, Mathias is playing it characteristically close to the vest.

"I would never announce until January of the year I'm running," he told a Baltimore television station earlier this week. "I really haven't made up my mind, but I'm getting closer to a decision."

Now in his 25th year on Capitol Hill, including four terms in the House, Mathias surprised some supporters in the last two months by voting in favor of funding the MX missile system and for the nomination of Attorney General Edwin Meese III.

Adding to speculation about Mathias have been rumors that two conservatives, former United Nations ambassador Jeane Kirkpatrick and Donald J. Devine, director of the federal Office of Personnel Management, were considering entering the GOP primary against him next year. Kirkpatrick, a staunch supporter of Reagan on defense and security issues who lives in Bethesda, just switched from the Democratic to the Republican Party. She has insisted she will not run against Mathias.

Although Devine could not be reached for comment, GOP activists said he has been campaigning unofficially around the state. Devine's bid to be reconfirmed as OPM director was postponed in a Senate committee this week, in part because it was unclear if Republicans could get Mathias' support, which was crucial.

Mathias and his supporters said his recent Senate votes on the MX and Meese were matters of conscience, but some political insiders wondered if his positions were a sign that he was trying to appease the GOP right wing in anticipation of running against Devine or Kirkpatrick for a fourth term in the Senate. Mathias had voted against the MX last year, but previously had supported it. After criticizing Meese earlier, he supported his nomination, he said, because an independent investigation of Meese's financial dealings concluded that Meese had done nothing illegal.

Devine, a longtime hawk on defense and a critic of spending on federal social programs, was one of Reagan's earliest supporters and has a considerable following in the historically divided Maryland party. But his faction has never succeeded in ousting Mathias, whose unwavering support of civil rights and outspokenness on nuclear disarmament have made him highly popular in a state where Democrats outnumber Republicans by nearly 3 to 1.

Statewide polls have shown Mathias to be the most popular politician in Maryland. His consistent electability in Maryland, which has a tradition of supporting liberal Republicans for statewide offices, has made him a key for the national GOP in 1986.

With 22 of the 34 Senate seats at stake held by Republicans, national party officials view Mathias as the strongest candidate to run in a tough general election against the expected Democratic challenger, Gov. Harry R. Hughes.

"The bottom line is that the pragmatic conservatives in Maryland are going to support Mathias," said one leading GOP official. "They want a Republican to win and to keep the Senate Republican."