Certainly markets aren't 100 percent efficient, if they were I wouldn't be a trader! However a ton of pretty rigorous statistical analysis has been done on the subject of risk adjusted returns across asset classes and the gross inefficiencies are only really there at extreme inflection points like crashes and then only for short time periods. Obviously smart well meaning people like you and I could discuss the intricacies of this for days and there probably really isn't a "right" answer. You may very well be right and stocks are currently providing risk adjusted returns higher than bonds at the moment. To my previous comment, selling OTM put options may also be legitimately producing risk adjusted returns higher than bonds (research says they routinely do on S&P500). My point is just that you can't compare "forward yield" to a treasury yield as if they're apples to apples the same thing, and even if there is a risk adjusted return disparity it still might not be appropriate to take advantage of it given the risk appetite of the OP. The St. Petersburg paradox is interesting reading on this subject if you're not already familiar with it.you'd think markets are efficient... but...
intra-market it's wrong all the time, that's why we have opportunities to buy at lower than the 'efficient' price.
not to mention, inter-market mis-pricing happens all the time... and currently there is still a very big mispricing between bonds and stocks, with the reason I have already stated. after experiencing the 2008, maybe also the 2000 crash, investors are scared... especially retail sentiment is still bearish... financial advisors/planners are still recommending the 60/40 mix based on age lol.. and just look at the example I gave, in summer 2016 junk was yielding 5%, 10-year treasury was 2%+... and AAPL was forward yielding 10%..
if markets were completely traded by machines, then I'd say we'll be very close to efficient... but humans, lol... humans are so stupid.