Commodore International Ltd., the nation's largest manufacturer of home computers, yesterday announced that it was laying off 540 production workers -- 40 percent of its manufacturing force -- for up to 10 weeks at two of its Pennsylvania facilities.

The layoffs are a result of "an inventory balancing" effort by the company in the wake of disappointing sales during the Christmas quarter, according to a Commodore spokesman.

"The market demand did not come anywhere near meeting their expectations this past year," said Peter Wright, of Gartner Group, a Stamford, Conn.-based industry research firm.

By last September, the company had amassed more than $440 million worth of inventory in anticipation of a strong Christmas selling season for its popular Commodore 64 computer. However, only between $350 million and $360 million worth of the machines was sold, according to Wright and company sources.

That represents a significant drop from the Christmas quarter of 1983 when more than $431 million worth of computers and peripherals was sold, propelling Commodore sales above $1 billion.

Earnings are expected to decline as well. In the 1983 Christmas quarter, Commodore's earnings per share was $1.62. Analysts have projected that earnings per share for Commodore's 1984 Christmas quarter might hit $1.20. But Wright and other sources who decline to be named have forecast that earnings will be below 50 cents a share.

"There's not a hell of a lot of good news for the rest of the quarter," one Commodore spokesman said, asserting that Commodore's new lap computer and an upgraded verison of the Commodore 64 -- the Commodore 128 -- eventually will boost revenue and earnings.

However, the company denies that there are significant inventory problems. "We are perfectly comfortable with our current inventory levels," the spokesman said, adding that the company's current inventory level is somewhere between $40 million and $50 million.

The spokesman pointed out that the higher-than-expected inventory levels were an industrywide reflection of the decline in the growth rate of low-end home computer sales last year.

Commodore stock closed yesterday at 14 5/8, down 1/4.