The U.S. economy, shrugging off the effects of the October stock market collapse, grew at a respectable 2.3 percent annual rate in the first three months of 1988, the government said Tuesday.

The Commerce Department, issuing its first look at overall economic performance this year, said the increase in the gross national product was propelled by a strong increase in consumer spending and the biggest surge in business investment in more than four years.Economists said any lingering fears that the record 508-point drop in the stock market on Oct. 19 would topple the country into a recession should be buried by the new GNP report.

In further good news, the growth was accompanied by a slowdown in the rate of inflation, with a price measure tied to the GNP rising at an annual rate of 2.4 percent, down from a 2.7 percent increase in the fourth quarter. This slowdown should help allay fears that stronger consumer demand would push up prices and force the Federal Reserve Board to raise interest rates to cool off demand.

Almost all of the fourth quarter increase in GNP wound up as unsold inventory sitting on shelves. At the same time, consumer spending was taking a rare nose dive, falling by 2.5 percent, the biggest drop in seven years. This combination has in the past been a harbinger of a recession.

This pattern was reversed in the first quarter with business inventories, which had risen by $39.4 billion in the fourth quarter, falling by $13.2 billion in the first quarter, indicating a success by businesses in reducing swollen inventories.

Much of the success in working down the inventory bulge occurred in auto showrooms, as dealers were aided by a new round of sales incentives.

This helped boost consumer spending by $23.6 billion in the first quarter, a 3.8 percent annual rate of increase. The report said more than half of that growth came in auto sales.

In other good news, the country's trade deficit, after removing the effects of inflation, narrowed by $3.6 billion in the first quarter, continuing the trend of improvement that began in mid-1986.