President Anwar Sadat, defying the Moslem militants of Iran and their Arab followers, today renewed his offer of asylum in Egypt for the cancer-stricken shah of Iran.

Sadat's gesture came in reaction to reports that the Mexican government refuses to allow the shah to return to the luxurious villa at Cuernavaca, south of Mexico City, where he had been living before coming to New York for medical treatment.

It reflected what Sadat's aides depict as a personal feeling of indebtedness to the shah, who extended a reported billion dollars in grants and loans to Egypt after the 1973 war with Israel and helped it survive a 1974 oil shortage with shipments of more than 4 million barrels of cruide.

Instructions "have been issued from Cairo to the Egyptian ambassador in Washington, Ashraf Ghorbal, to inform the shah and the American government that Egypt is ready to welcome the shah at any time," said an announcement from, the presidency. "The presidential plane is ready at the airport for takeoff at any moment to bring the shah to Egypt."

Sadat himself, speaking to reporters after noon prayers at a mosque 15 miles north of Cairo, personally repeated, the offer, but added that he has received no official response from te U.S. government or the shah's entourage. He dismissed reports suggesting Washington would be unenthusiastic about the shah's staying here.

Opportunities for Iranhian retaliation against Egypt appear limited. Egypt severed diplomatic relations with Iran last winter, and almost all its embasssy staff in Tehran has been called home. As for oil, Egyptian production in the Sinai and the Gulf of Suez has reached about half a million barrels a day, enough for Egypt's own use and for exports worth nearly $2 billion this year.

Observers here expressed belief that the shah also could receive adequate protection should he accept Sadat's offer, renewed several times since the shah left here last January. Egyptian security forces are regarded as effective by specialists.

In principle, at least, Egypt has the facilities to treat the cancerous condition in the shah's lymph glands. Radiation treatment is said to be possible here at a cancer center affiliated with the University of Cairo and the Massachusetts Institute of Technology, in addition to a modern military hospital in the Cairo suburb of Maadeh.

Politically, however, Sadat's trumpeted offer of hospitality raises some potential risks. The leftist opposition in the People's Assembly, although nearly powerless, registered public disapproval of Sadat's earlier asylum gestures. More importantly, the definace of Khomeini's Islamic fundamentalism could arouse ire among Egypt's own conservative Moslems, particularly in the restive climate that has engulfed the Moslem world.

Most Western diplomats here, however, say Sadat is in little immediate danger of running into stron opposition from conservative Moslems, despite these signs of a fundamentalist current and the pressure of a small Moslem Brotherhood organization.