For months, Americans representing various U.S. companies here have been asking themselves, as one of them put it last summer, "What the hell are we doing here?"

Since president Jimmy Carter imposed a partial embargo on U.S. exports following the Soviet invasion of Afghanistan two years ago, the American businessmen in Moscow have had precious little to do. Many fill their time playing backgammon during office hours, conducting long lunches and attending every performance of the Bolshoi Ballet.

With the exception of grain sales, exports to the vast Soviet market have not lived up to the initial promises of detente. President Reagan's new trade restrictions, which are meant to show U.S. displeasure at Soviet influence in the Polish martial-law crackdown, are likely to diminish sharply prospects of Soviet-American trade for a long time.

At issue is what impact Reagan's action is likely to have on the Soviet economy.

Western diplomats and observers here believe that the impact will be negligible except that the Soviets will have to redesign some aspects of the pipeline they plan to build from Siberia to Western Europe. Among the sanctions imposed by Reagan was a suspension of licenses for sales of a newly enlarged list of oil and gas equipment, and the Soviets are expected now to buy the equipment for the pipeline project from West Germany or Japan.

Statistics also demonstrate the Western observers' point. Since the Carter embargo, U.S. nonagricultural exports to the Soviet Union have withered to $380 million for the first eight months of last year. The total U.S. exports in 1979 were $3.6 billion and the Department of Commerce predicted, before the Soviet occupation of Kabul, that exports in 1980 would reach $4.8 billion.

Under stiff political pressure, Reagan lifted Carter's agricultural embargo in April and the United States signed an agreement with the Kremlin raising the grain available to the Soviets to a record 25 million tons.

Short of a new grain embargo, however, the United States has little trade leverage on the Soviet Union. Hence, Reagan's measures are not expected to have a significant impact on the Soviet economy if they are not accompanied by similar sanctions by other Western countries.

Judging by remarks of allied diplomats here, there is little enthusiasm among America's allies to follow Reagan's lead.

The government news agency Tass has noted allied reluctance with satisfaction. As one Tass commentary put it, "Trade with the United States makes up a small fraction, only a few percent, of Soviet foreign trade and even a more meager part" of the Soviet gross national product.

In what is partly a self-serving argument, a Tass commentator said that American companies have forgone during the past two years sales opportunities of $3.7 billion while American farmers could have sold an additional $1.5 billion worth of grain to the Soviet Union each year.

Soviet sales to the United States have dropped from $873 million in 1979 to $453 million in 1980 to $197 million for the first eight months of last year.

But the Soviets already appear to have discounted the importance of Soviet-American trade. Since the Carter embargo, American businesses have complained about repeated shifts in U.S. restraints and licensing policies, and many companies quietly have reduced their presence here while Pan Am and Citibank have pulled out of Moscow.

The main thrust of Soviet policy now is to blunt the political impact of Reagan's sanctions. In the immediate term, this means to secure West European food aid to Poland--thus easing Moscow's strain in supplying the Poles--and prevent Poland's default on its huge debt to the West.

The bankruptcy of Poland would imperil the credit rating of the entire Soviet Bloc and endanger Moscow's ability to borrow in Western markets to finance grain purchases this winter.

A long-term objective is to maintain trade links with other Western countries at a time of increased difficulties within the Soviet economy.

After three successive bad harvests and the new strain of military competition with the United States, basic structural weaknesses in the economy have become more obvious. Poland has put additional burdens on Moscow.

The Soviet Union has been supplying Poles with raw materials, energy and food for the past year in an effort to shore up the Communist government in Warsaw. But details of Soviet assistance have filtered out from Warsaw, not Moscow. It is politically difficult here to explain substantial shipments of meat to Poland when Soviet consumers have a hard time finding meat in their shops.

According to the Economic Gazette, Polish deliveries of coal and other products to the Soviet Union have dropped by about 50 percent of scheduled targets for 1981. The Soviets, however, have increased their deliveries to the Poles. This means that apart from direct grants, the Poles have run a trade deficit estimated to be in excess of $3 billion.

The amount of Soviet hard-currency credits to Poland is not known. But the Soviet hard-currency deposits with Western banks were down by $5 billion to $3.6 billion in the period between last January and June. Soviet gold sales also are known to have increased last year in a falling market, an indication that the Soviets are seeking hard currency for trade.

Against this background, it seems clear that the Soviet Union will have to pay a heavy economic price for Poland.

The Polish crisis, even without unified Western sanctions, is expected to inflict serious damage on the entire Soviet Bloc. Western specialists here say that this is, ironically, a result of Soviet efforts during the past decades to bring about a greater integration of East European economies and thus secure Moscow's grip on the region.

Poland is Moscow's second major trading partner, with the 1980 bilateral flow of $11.3 billion, compared to $13 billion with East Germany.

Polish trade accounts for 9 percent of Soviet foreign trade. The relationship is far more crucial to the Poles, whose deliveries to the Soviet Union account for 30 percent of Polish exports. The Soviet Union supplies nearly 60 percent of Poland's raw materials and nearly 90 percent of its energy.

While the Soviets plan to cut their oil deliveries to other Eastern European countries by 10 percent, they increased oil deliveries to Poland last year by 2 million tons to 16 million tons. A recent study here calculated that the Soviet raw materials and oil deliveries to Poland have saved Warsaw about $8 billion during the last five years.

Polish failures to supply their East European partners with specified commodities and parts reportedly have led to disruptions in various Soviet and other East European plants. But the Soviet Bloc has continued to assist Poland since a Polish economic collapse would be an economic as well as a political disaster for the entire bloc.