Hollywood actor John Gavin, perhaps best known in Mexico, as the star of a glamorous Bacardi rum commerical, went before the Senate Foreign Relations Committee yesterday to prove he was more than just a pretty face.

Nominated by President Reagan to be the next ambassador to Mexico, he handled himself with aplomb. He even managed to fend off the questioning of Sen. Jesse a yhelms (R-N.C.) who wanted to know whether Gavin was sufficiently alarmed about Marxist influences in Mexico.

Helms said he was a bit concerned himself because of "reports I've received about the increase of Marxist insurgencies in Mexico."

Gavin who graduated from Stanford with a degree in Latin American economic history, allowed that "the Marxist ideology is indeed espoused by a certain sector" of Mexican society, but he didn't seem particularly excited about it.

"I believe, an balance, that we need not fear for the security of the Mexican repulbic," he told Helms at the confirmation hearing.

Looking trim and diplomatic in a dark pin-stripped suit, Garvin, 49, an old friend of President Reagan, began his testimony with a brief five-paragraph statement in which he professed his firm dedication "to the proposition that nothing could be better for our nation than a free, viable and prosperous Maxico."

Wryly addressing the public attention focused on his acting career, he added that he had 40 motion pictures that he could show "to prove that I'm no actor."

Under questioning by Sen. Larry Pressler (R-S.D.), Gravin impatiently sought to dismiss the Bacardi rum commercial that has sent him flashing across Mexican television screens for the past four years. Pressler wondered whether the ad was still running and whether it might have an impact on Garvin's diplomatic career in Mexico City.

"The answer to both those questions is no, sir," Gavin replied tersely. Pressed for a bit more detail, the nominee added only that he considered the TV commercial irrelevant and "water over the dam."

At other points, Gavin, whose mother was born in Mexico, rattled off data about Mexico's grain imports, its fishing industry and population. He also stressed how "sacrosanct" the policy of nonintervention was to Mexicans.

Senate Foreign Ralations Chairman Charles Percy (R-Ill.), whom Gavin referred to as "Chuck" before the hearing's end, made it plain that he was more than satisfied.

"I was impressed with your background when I studied it," he told Gavin, noting the actor's fluency in Spanish, Portuguese, Italian and French. "I'm more impressed with your grasp of the present situation."

Helms voiced his support, too, though not without a last rejoinder to Gavin's talk about the Mexican stress on nonintervention by foreign powers.

"The fact is there is intervention by Marxists sponsored by the Soviet Union and using Castro," Helms protested. "Would you agree that the entire political situation in Mexico is not all that stable?"

"No, sir," Garvin said. "I don't think it is right for a candidate for the office of ambassador to Mexico to make any such statement at this time."