President Reagan has sprinkled his campaign this year with optimistic predictions about the $170 billion federal deficit that mask painful fiscal choices his advisers and outside experts say he will confront if reelected.

In his challenge to Reagan, Democrat Walter F. Mondale has rung alarm bells about the deficit's dangers, even taking the politically risky course of coming out before Election Day for a major tax rise.

But Reagan's response has been that the problem is not as severe as his rival claims. He says that he is not going to panic about the deficit and that economic growth will ease it. He says unspecified "overhead" in government can be eliminated. He says increasing tax rates is not a legitimate way to reduce the deficit. He says, "We can make further budget cuts without affecting how much goes to help the needy."

But many of Reagan's aides say privately that they do not believe this rosy analysis.

Insiders have muted their concerns until after the election. But they nonetheless share a widespread view among outside experts that, to reduce the deficit significantly, Reagan will face unpleasant choices -- if he is reelected -- that were never acknowledged in his optimistic campaign speeches.

Alice M. Rivlin, former Congressional Budget Office director, said in a recent Urban Institute study that the deficit dilemma arises "from the simple fact that most of us, including President Reagan, want more from our government than we want to pay for."

Reagan got a "consensus" for his 1981 program, but it did not extend to cutting "broadly popular programs," she said. "The president and the public shared the hope that some economic miracle would make these choices unnecessary," she said. "It was a miscalculation born of reluctance to face the unpleasant."

In the heat of the campaign, Reagan has put off-limits to budget-cutting such items as Social Security and Medicare benefits, although other savings may be found in Medicare. He has all but ruled out tax increases. Interest payments on the national debt are rising. Reagan seems unwilling to scale back his defense buildup significantly.

The bottom line is that of a $1.006 trillion budget estimated for fiscal 1986 -- with which Reagan will begin to grapple immediately if reelected -- he has already put about $717 billion, almost three- fourths of it, out of bounds.

The remaining $288 billion will have to carry the burden of cuts toward a deficit now estimated by the administration at $165 billion.

In other words, Reagan would have to eliminate half of all the government's functions beyond defense, Social Security, Medicare and interest payments to wipe out the deficit and balance the budget.

While no one expects Reagan to try to balance the budget in one year, an increasingly small share of spending is available for cuts. Thus, many fiscal experts say there is no way Reagan can seriously tackle the deficit without touching the sacrosanct areas of taxes and defense.

If he balks at these, Reagan has also complicated his other options by suggesting this fall that he would not cut popular middle-class programs such as student aid. "There is more of that being done than has been done in the past," he told a Bolingbrook, Ill., high school audience Oct. 16. "And we're not reducing it."

On the contrary, Reagan's budget planners have targeted this and other federal programs that benefit the middle class for cutbacks in a second term.