You can defer the taxes until you sell, and heirs get a stepped up basis. You can often even buy the stock in a tax free account.
The only thing you can't do is "1031 exchange" one stock for another, but there's no reason to do that when we're talking about broadly diversified portfolios.