One can do that with treasuries or T-bills which historically have earned a real return. In a crisis one often finds that treasuries are negatively correlated with equities which can be a boon.
Bonds are better suited for that purpose, however it's still preferred to just hold stocks over the long term. Holding bonds provides stability at the expense of drag.