It’s an interesting question because it does depend on other stuff.
For a long-term investor, then 100% stocks in an index is likely to give you the best long-term growth on a risk-adjusted basis than investing in any single stock. It may not be the optimal in terms of risk/reward, though because fixed income and other asset classes can reduce the volatility of your portfolio.
Putting bonds in a portfolio will generally reduce the average return, simply because bonds tend to have lower returns than stocks, but they tend to be less correlated to the stock index, and so can reduce the portfolio’s volatility by more than they reduce the return. Even aggressive investors will probably want to have some fixed income, and possibly REITS, Commodities, and alternative investments in there.
However, if the more diversified portfolio can’t deliver sufficent return for your long-term needs, and you can’t lever up (modestly) to get there, then all-stocks may be the best alternative after all.
Finally, there’s the question about the current bond environment. People keep saying, “Bond yields are so low, they can only go up, so bonds are going to lose money.” If your expected return is less than the risk free rate (in this case, cash), then something is no longer helpful even as a diversifier. So the real question is whether bonds can deliver returns in an environment like today’s. If people are counting on mean reversion, it looks like you are stuck with the YTM, which is higher than the Cash rate for now, but maybe not in the future, and that has people wondering if there is a point to having bonds at all.
The most likely thing is that bonds should be a smaller part of the portfolio (or rather, duration should be smaller) and that allocation - rather than be transferred to equities - should be substituted with cash, to be deployed at such time that either 1) bond yields are better (inflationary scenario), or 2) there is a major stock crash and equity prices are better (deflationary scenario).