Huh? Any investment is going to incur capital gains taxes when sold. Commissions are trivial for large stock purchases and certainly are very low compared to say gold or property.
If a company is ejected from the S&P 500, tracking funds tend to eject it as well. Also these charts tend to not be dividend adjusted, further increasing the benefit of stocks. Check out SPY; it actually has out-performed the S&P 500 (I believe due to dividends and what not).
Physical gold purchases don't need to be declared in many places. Which means 0 tax, plus the fact that the government doesn't know you even have it, were they to introduce any kind of legislation.
These charts usually include dividends. When they don't they are very crappy. In many international stocks dividend is too substantial to be possibly missed.
This is never shown in these fancy charts, but any investor will see his bottom line affected by these costs.
Also, companies can be ejected out of S&P and replaced by more successful companies. These events are also routinely hidden from graphs.