Pennzoil Co., a medium-sized oil company that has been the subject of takeover speculation, announced yesterday it had arranged a $2.5 billion line of credit with a group of 25 U.S. and foreign banks.

Company Chairman J. Hugh Liedtke said in a statement, "Pennzoil has made this arrangement to provide maximum flexibility to act quickly on various internally or externally generated business situations."

Wall Street immediately lit up with speculation that the company is considering a takeover, or that it would draw down the credit to worsen its debt position as a way of staving off an unfriendly suitor.

But in a telephone interview yesterday afternoon, Liedtke said the company has not been formally approached with a takeover offer and that it "didn't have anybody in mind" for a takeover attempt. Instead, he said, "If an opportunity presents itself, we want to be in a position to take advantage of it quickly, without having to run out all over the world to find our financing. These situations move so quickly that you could be left standing in the gate if you don't have financing."

Liedtke said none of the credit had been used yet, although $10 million will be drawn down to pay closing costs. Pennzoil will pay the prime lending rate plus one-quarter percentage point on the money it borrows, and for just having the line of credit it will pay three-eighths of one percent, or $9.375 million a year.

Any loans from the Citibank-led consortium will be repaid by between 65 percent and 75 percent of the revenues from the company's proven domestic oil and gas reserves, and 40 percent of the revenues from its sulfur reserves, Liedtke said. Huge by any standards, the credit amounts to approximately the entire current market value of Pennzoil's equity securities. Liedtke said if the entire credit is drawn down, the payments would be supported by about 28 percent of the company's assets and an average of 14 percent of projected revenues.

Houston-based Pennzoil, with 1980 revenues of $2.48 billion, produces oil and gas along with copper, molybdenum, potash and sulfur. In recent years the energy and mining branches of the company have roughly comparable revenues, but oil operations have been far more profitable.

Potential suitors for Pennzoil include Seagram Ltd., the cash-laden Canadian distiller that was apparently blocked in its attempt to acquire Conoco Inc. when E.I. du Pont de Nemours & Co. announced plans for a friendly takeover of Conoco.