She was talking with skeptical foreigners who paid more attention to her long legs and black bikini than to her ardent defense of marxismo-leninismo and the Cuban revolution.

So when the argument shifted toward historical references that went beyond her reading and eventually bordered on mockery, the 24-year-old Havana woman accused her friendly tormentors of displaying machismo by refusing to take her seriously.

"Okay," cracked a Latin American journalist with long experience in the Cuban capital, "but it's machismo-leninismo." Letter From Cuba

Such defense of Cuba's revolutionary principles may have been drummed into the population since Fidel Castro took over in 1959. Newspapers, radio and television are government-controlled and firmly oriented toward building popular support for the system. But however it got there, and at least for display to an outsider visiting the island, it is always there.

Conversations with Cuban government officials and other Cubans in a position to meet foreigners routinely include a defense of the revolution and its ways. What the masses of Cubans would say in the privacy of their homes a short-term visitor can only guess. But what the people encountered by chance do say often contains a comparison with pre-1959 Cuba designed to make the Marxist system look good.

THE HEADWAITER at the Riviera Hotel's L'Aiglon dining room, for example, began work there when the establishment opened in 1957 as a center for vacationing Americans on the lookout for gambling and seamy entertainment that had made Havana famous. Asked about the difference between then and now, he omits the frayed furniture and syrupy Hungarian wine and notes instead that "the bourgeoisie" is no longer the only class showing up for dinner.

In addition, he says, black Cubans can now come in, whereas before they were not even allowed inside to work as dishwashers in the once-exclusive seaside hotel.

Perhaps the most enthusiastic are the youth who have known nothing else, like the woman in the bikini who proclaimed with pride that she was born with the revolution.

One teen-age boy from the provinces begins by trying out his Russian. When he finds out the man sitting next to him is American, he explains he would have preferred to learn English because it is more useful abroad, but Russian was easier. Then, after describing his misadventures trying to find a sister honeymooning in the capital, inevitably he wants to know what the foreigner thinks of the Cuban revolution.

Several questions elicit only noncommittal comments about what a nice island Cuba is. So he turns and asks point-blank: "Socialism certainly is better than capitalism, isn't it?"

"Well, socialism does have its good points," comes the cautious reply.

"Yes, and Cuba has the only real communist system in the world," he asserts proudly, "Cuba and the Soviet Union."

THE REVOLUTION is defended in less earnest ways as well. One is the billboard. It is big. It is brightly colored. And it has neon lights to get the message across night and day.

On one side stands a ferocious-looking Uncle Sam. On the other, guarding a small island with a palm tree, stands a Cuban youth with a gun.

"Messrs. Imperialists," he says in the lighted lettering, "we have no fear of you."

To make sure everyone who should gets the point, the sign has been erected just off the seaside Malecon boulevard a few hundred feet from the U.S. Interests Section building, facing the offices of American diplomats assigned to the Cuban capital.

ANOTHER WHO DEFENDS the revolution by making people laugh is Pancho, star attraction at the Burro Bar on Mayabe lookout point near Holguin in eastern Cuba. The bar's advertisement reads: "Where you can see Pancho the donkey, the only one in the world that eats chicharrones fried pork rinds and drinks beer. Thanks for your visit."

Pancho indeed drinks beer, bottle after bottle provided by customers who by tradition include the donkey when it is time for another round. Local residents say he has consumed as many as 35 bottles a day, so many, in fact, that he fell sick recently and had to go on the wagon for a while.

But Pancho has recovered now and is back on the brew. Hanging his glassy-eyed head over the rails of a corral adjoining the bar, he sucks his beer from regular brown bottles handed his way by the waiters. When asked whether he would like more, he always nods yes.