Let's try to get to the core issues.
If Bills passing would require the foundations assets to be liquidated how would that happen?
It wouldn't. The foundation would continue to own the shares and would not need to sell them. The foundation isn't owned by Bill Gates. It's a key point of being a foundation.
But what about if the shares are actually part of the estate?
Good question. But there is no requirement to sell shares even then. The shares can simply be transferred to the inheritor(s), who can choose to sell them if they wish.
What if the need to sell was written into the will?
That's pretty unlikely for two reasons. One is that there is no benefit to anyone in forcing the sale, and the second is that anyone who owns shares with this high a value already has a plan in place that avoids the huge tax payments that this would would result in. But even if it happened, the executors of the will are required to act in the interests of the benefactors. They would be required to sell the shares "in a responsible way" so as not to seriously reduce the proceeds of the sale. Estates of this size take months to process, so there is no problem with a gradual sell off.
What effect would this have on the company?
Not much, even if the sale happened quickly. Even if the share price declined immediately, it would probably come back pretty quickly because the fundamentals of the company haven't changed. As long as the reason for the shares is the forced sale, people are going to want to snap up the bargain-valued shares of a good company, bringing the price back up.