Isn't it a greater risk to buy bonds when the government is in debt?
Government will never default, they would just print some money to pay back the debt, so the risk of default is almost 0
Many investors have so much money that they don't even bother risk it, even a small interest will give them millions of dollars of income per year. And typically it is the central bank who buy large amount of government bonds to adjust the money supply
the only risk it could be if the gov is corrupted or if the gov of your country get bankrupt, but it is not somethign that happen over night
in the worst case you can sell with a small loss, because the spread is usually very minimal, seeing how they play with a very small interest even below 1%