The United States is not going to let Mexico go down the tube.
That fact underlies the scurrying now under way in Washington and New York as government officials and private bankers work out viable bailout arrangements designed to keep Mexico afloat economically.
There are many reasons. The US no more wants an unstable neighbor on its doorstep, with the potential for social and political explosion, than it wants the collapse of the Mexican economy, with its $90 billion foreign debt.
Such a collapse could trigger all sorts of unhappy consequences for the US economy and particularly for US banks that have loaned heavily in Mexico.
The US bailout program includes a variety of new loans and credits amounting to $3.7 billion; debt repayment rollovers and debt rescheduling for $18 billion; a 45 percent increase in purchases of Mexican oil; and a $4.5 billion International Monetary Fund loan. This is aimed at getting Mexico through the difficult autumn months before President Jose Lopez Portillo is replaced by the new government of President-elect Miguel de la Madrid Hurtado. With unconfirmed rumors circulating that the Mexican military wants to overthrow Mr. Lopez Portillo, there is a growing sense of urgency about the bailout.
The IMF loan will give the new government some breathing room. But not much. Washington is very much aware that more short- and medium-term loans and credits to Mexico may be necessary in 1983.
On top of all this, Washington is horrified at the escalating flow of Mexican illegal immigrants into the US at a time when the US economy is none too healthy.
The flow is reaching alarming proportions. US Border Patrol officers in Arizona, California, New Mexico, and Texas, for example, are arresting illegal aliens in record numbers as more and more Mexicans attempt to flee their financially troubled nation.
Moreover, the number of migrants who elude detection is high and going higher. Hard-pressed, understaffed, and widely dispersed US immigration people say that ''illegals'' from Mexico are crossing the border at rates which ''defy all past experience.''
As many as 20,000 a day are estimated to be crossing undetected - a rate which if extrapolated over a year would amount to 7 million.
With unemployment running at 40 percent in Mexico, it is no wonder so many Mexicans are fleeing to the relatively more stable and more promising US. How to effectively stop the flow is a dilemma that Washington has yet to answer. For a time, the seriousness of the illegal alien problem simply went undetected for months by Washington officialdom involved in other world crises and US domestic problems.
For that matter, Mexico's own deepening economic traumas were largely unnoted in Washington as they mounted through 1981 and into 1982. It took the collapse of the Mexican peso last month to galvanize a Washington bureaucracy into action.
And even then, there was some discussion in late July of letting Mexico sweat a little to secure greater Mexican support for US Hemisphere initiatives, like those in Central America which Mexican President Lopez Portillo had staunchly opposed.
That discussion, however, is now a thing of the past as efforts to shore up the Mexican economy are given high priority. Reagan administration officials are rushing to put the finishing touches on bailout arrangements that will allow Mexico time to put its own financial house in order.
For the moment, the hope in Washington is that the outgoing Lopez Portillo administration and particularly Jesus Silva Herzog, its industrious and imaginative treasury secretary, will be able to get at least a semblance of order into the Mexican economy.
Mr. Silva Herzog appears to be trying. He has been the chief link between the government in Mexico City and Mexico's creditors in Washington and New York. He is clearly aware of Washington's determination to keep Mexico from becoming an unstable neighbor.
He also know that the flow of Mexican migrants into the Us may be the most vexing problem in the current situtation.