BankAmerica Corp., for years one of the biggest lenders to the Third World, has sharply reduced its outstanding medium- and long-term loans to developing countries over the past year, the bank's executive vice president for global debt restructuring, Peter McPherson, said in an interview this week.

The bank has sold or swapped $1.7 billion worth of developing country debt and has pulled out of seven countries altogether. Another $1.1 billion worth of Mexican debt is now backed by U.S. government securities under the Brady Plan, McPherson said, referring to the plan under which a debtor country uses U.S. government securities to guarantee eventual repayment of the principal of its debts.

By the end of 1990, BankAmerica expects to whittle down its exposure in developing countries to $3.2 billion (excluding Mexico and Venezuela debt that will be backed by U.S. bonds), down from $6.9 billion a year ago.

The sharp cutback in BankAmerica's Third World lending is not an isolated phenomenon. Major American banks in general have been reluctant to lend to developing countries at a time when those countries have pressing short- and long-term needs.

During the annual meeting of the World Bank and International Monetary Fund this week, central bankers and finance ministers from developing countries are appealing for support for reform and investment programs. "It is fundamental for us to have foreign capital play a role in the process of modernizing our economy," said Brazil's finance minister, Zelia Maria Cardoso de Mello.

But BankAmerica's program suggests that Brazil and other developing countries will have to attract new development loans amid a major shift in approach toward Third World lending. It also suggests that developing countries will have to turn to the IMF to finance oil bills swelled by recent price increases.

During the 1970s, most major U.S. banks aggressively lent money to governments or state-owned companies in developing countries. Much of the money was used to pay old debts rather than finance new investment. The banks charged high interest rates, and the loans became major sources of bank earnings.

But in the 1980s, as developing countries staggered under the twin burdens of high oil prices and big debt burdens, many nations fell behind on interest payments. Loans to Third World countries became drags on bank profits and depressed the price of their stock. Banking regulators have forced major banks to set aside special reserves for losses on the loans.

"It was a big mistake to lend to Third World for balance of payments and budget deficit finance. That's the job of the IMF," said Shafiqual Islam, a senior fellow at the New York-based Council on Foreign Relations. "Now the banks have had their fingers burned pretty badly, and it's been clear for some time that banks don't want to lend to developing countries on any kind of medium- or long-term basis."

In the 1990s, bankers say, countries will be hard pressed to woo foreign capital without sweeping economic reforms. "We are keeping debt of countries that have undertaken real economic reforms," said McPherson. "But the market is saying that outside credit will be tough to get without reform and without maintaining relationships with creditors."

Developing country officials here this week are making an effort to persuade foreign lenders and investors that such reforms are underway. Brazil's central bank governor, Ibrahim Eris, said the government would sell off its stakes in the industrial sector and stick to health, education and infrastructure.

From BankAmerica's point of view, slashing loans to developing countries reduces a problem that has long cast a pall over future earnings.

The San Francisco-based bank has set aside $1.7 billion for potential losses on Third World debt, enough to cover 34 percent of its total developing country loans or 54 percent of the loans outside the "Bradyized" Mexico and Venezuela exposure. The bank has been adding to that reserve every quarter, including $100 million set aside last quarter, although much of that has been covered by deferred tax losses from the 1980s.

But the bank has used a number of approaches to rid itself of its worst problem loans in developing countries.

It has sold loans on the secondary market to people who, for a discount from the face value of the loan, are willing to take a chance that the interest payments will be made. BankAmerica won't say what prices it received for the debts, but according to a Salomon Brothers Inc. survey, developing country debts can be sold for anywhere from 3.5 cents on the dollar to about 70 cents on the dollar.

BankAmerica has also swapped loans for equity interests in companies in developing countries. The bank's program has meant that, like many other American banks, it has become involved as an investor instead of a lender in some ventures. The bank has swapped $21 million of Brazilian debt for a 6.4 percent stake in Embraer, a Brazilian aircraft manufacturing company that exports commuter aircraft.

The privatization of state-owned industries in developing countries may succeed in luring banks to stay involved in developing countries. "The corporate finance people in banks are hot on the Third World," said Riordan Roett, a Johns Hopkins professor and expert on Brazil who consults for Chase Manhattan Bank. "But the retail division wants to cut back. That will be a tension in banks in the 1990s."