Under the new tax law, companies may no longer be able to entirely avoid taxes on overseas holdings. But the tax they pay on those assets will drop to a rate of 8 to 15.5 percent, from around 35 percent. To avoid paying the higher rate under the old system, banks and other companies simply left their cash abroad.

Public companies are required to account for changes to tax laws during the quarter in which they are enacted, so even though the banks will not be sending checks to the Internal Revenue Service yet, their balance sheets must be adjusted to reflect what they will eventually owe.

Even as it made the necessary accounting adjustments resulting in the charge, however, Goldman was working to maximize the benefits it can still access before the new tax law takes effect on Jan. 1. It disclosed in filings with the Securities and Exchange Commission on Thursday that it had delivered shares to Goldman’s chief executive, Lloyd C. Blankfein, and other top executives, completing the transfers earlier than in previous years. It typically delivers shares as part of its executive compensation packages in January.

According to a source familiar with the matter, the move let the bank access a tax credit that will disappear under the new law, worth $140 million this year. A “couple hundred” people in high-tax areas received their stock early, said the source, who spoke on condition of anonymity because the information was not public.

The shares Mr. Blankfein and others received on Thursday cannot be sold for five years. They are not part of the executives’ 2017 pay packages; rather, they are portions of deferred compensation packages from the three previous years, the source said.