The federal government, which regularly denounces oil profiteering both in this country and abroad, is about to sell 127,465 barrels a day of its own crude oil at prices ranging up to $41 a barrel.

Moreover, it is selling some of this oil to a Japanese trading company, and some to a small company reportedly tied to the Khashoggi family of Saudi Arabia.

The oil is from the Elk Hills Petroleum Reserve in California's Kern County. On the basis of bids just received, at least 90,000 barrels a day of it will be sold for $35 a barrel or more. (Most of the rest will bring less, partly because it was set aside for a separate group of small independent buyers.)

The highest bid of $41.12 a barrel -- a "bonus" of $11.12 above the basic $30 "posted price" in the area -- was made on 10,000 barrels a day by Phillips Petroleum.

On an additional 21,000 barrels a day, the high bidder -- offering an average bonus of $5.23 a barrel -- was Oasis Petrol Energy Co. of Culver City., which has ties to and may be controlled by the Khashoggis.

C. Itoh Ltd., one of the large world-wide Japanese trading companies that is a major buyer or Iranian oil, was the apparent high bidder for 10,793 barrels a day with a $4.82 bonus.

Elk Hills oil, like all other oil produced in the United States, cannot be exported without special permission, which the Carter administration would not consider granting.

But some oil company executives involved in the Elk Hills bidding expressed concern a buyer such as C. Itoh could, in effect, accomplish the same thing by swapping its Elk Hills oil for a similar quantity elsewhere in the world that otherwise would have come to the United States. Oil swaps are routine throughout the industry.

C. Itoh executives in Los Angeles declined to answer any questions about the company's energy activities in the United States or about the intended use of the Elk Hills oil.

Other industry sources knowledgeable about crude oil supplies in the United States said this is the first time C. Itoh has acquired rights to American production, but these sources thought the oil is probably destined for U.S. customers of C. Itoh.

It is the anomalous position of the U.S. government on the pricing issue that has provoked the most caustic comments from oilmen, however.

While the Department of Energy was mulling the Elk Hills bidding results this week, State Department spokesman Hodding Carter III sharply criticized the Mexican government for raising the price of Mexican crude oil from $24.60 to $32 a barrel. "The increase is unjustified and we deeply regret it," he declared.

An official of a major oil company that shunned the Elk Hills bidding noted sarcastically, "It's interesting that the U.S. government has the highest official selling prices for crude in the world."

Carter administration energy officials are acutely aware of the anomaly of their position on prices and the questions that are being raised about the identity of some of the successful bidders.

Officals still expect the Elk Hills bids to be accepted, probably about Jan. 20, for a six-month period beginning Feb. 1. However, one White House aide added, "We are looking at some aspects of the sale which we think deserve consideration before we award the contracts."

Department of Energy officials said that, however it may appear, the government under a 1977 law really has no choice but to accept bids from "the highest qualified bidder" if it decides to sell oil from the nation's three petroleum reserves. It has chosen to sell all it can to help cut imports.

Anyone is free to bid, though the law limits any one company from getting more than 20 percent of the government's share of Elk Hills production, and 25 percent is set aside for small companies.

One DOE official drew a distinction between an open bidding process required by law and a unilaterally set "official" price such as those by most oil-exporting nations, including Mexico and members of the Organization of Petroleum Exporting Countries.

In the case of Elk Hills, he said, "The oil companies bid it up; not the government."

And bid it up they did. Last month's sale will yield the government nearly $4.4 million a day for its oil, or about $1.6 billion over a year. At the last sale, which covered 12 months, the companies bid an average bonus of only about $12. The difference in prices will be worth about $1 billion a year to the government.

Phillips' high bid raised eyebrows throughout the oil industry. Wayne Glasgow, North American crude supply director for Phillips, said its bid was based on what the company thought it would take to guarantee getting the crude it wanted.

At the time of the bidding in Taft, Calif., on Dec. 20, George Sears, who represented Phillips, was quoted as saying, "We expect to see tight crude supplies. We came out here to buy oil and it looks like we did."

Glasgow said the 10,000 barrels a day will be resold to Tosco Corp., which Phillips must provide with about that amount of crude under terms of a contract covering the sale of a Phillips refinery in the San Francisco area to Tosco several years ago. He declined to say how the oil would be priced to Tosco.

Tosco, which has been getting about 24,000 barrels a day for the past year from Elk Hills, came up with nothing in the bidding. Tosco's bids ranged from 25 cents less than the posted price, now $30, to a bonus of $1.09 a barrel.

Tosco officials said they have already covered part of their crude shortfall through other purchases and expect to be able to find additional crude as they need it.

But other disappointed bidders may have trouble finding alternate sources of crude. Some of these said they may ask the government for allocation of crude oil from other oil companies under the so-called "buy-sell" program, through which small, independent refiners are entitled by law to buy oil from large, integrated companies.

The company getting the largest amount of Elk Hills oil, Oasis Petrol Energy, markets gasoline in Saudi Arabia, Denmark and the United States. The company also sells aviation gasoline, crude oil, and some fuel oil refined in California.

A person answering the telephone at the Oasis office in Culver City said no one would respond to questions about the company unless they were submitted in writing to the firm's legal counsel, Tariq Kadri.

Finn Moller, Oasis president, confirmed last summer that the company is a partner in some ventures with the controversial Saudi Arabian financier Adnan Khashoggi, but would give no details. Industry sources said last month Khashoggi now owns a substantial minority interest in Oasis, and that he has been a backer of the company for some time.

Oasis bought 84 gasoline stations late in 1978 from Research Fuels Inc., of Fort Worth, Tex. Its only refinery is a small one in Bakersfield, Calif., that is equipped to handle only heavy crudes, not the type from Elk Hills, industry sources said.

Some of the disappointed bidders at Elk Hills had no ready suggestion of how the government could deal in the future with such high bids at a time it is trying to persuade other countries to keep their oil prices down.

"In a free market sense," said one, "the governmentd is entitled to the bids. If the government were a private enterprise, they would be compelled to get the fair value for their oil. But on the other side, where is the consistency of the government sending the secretary of the treasury to Saudi Arabia to ask for restraint? Inguess I have no answer."