This is a brilliant idea. In some sense, the gov't is the biggest non-profit in any modern nation. Large corporations love it when you "moonlight" at a non-profit. Your are idea is not so far-fetched! I'm sure lots of techies would love to pitch-in and help to improve an online gov't service -- be it local, regional, or national.
I don't know how to do it in the US, but in Canada you should be able to get these types of short-term gigs if you do a bit of networking in Ottawa and mention that you're a specialist in X, and that you want to help out here and there to give back. Wont take long. People want to bring in experts that will take occasional lower pay for impact.
Edit:
Also, the servers are BEEEEFY, haha. They might be cloud first these days, but when I was there it was still all on-premises and man alive are those machines huge.
I do know some CCs and branches are trying to make changes but the PS in general is an absolute dinosaur for hiring and shows no signs of improving to match the bleed they'll have as people start retiring out.
I recall someone I hired had also applied for a government job while completing his degree. They called him back a little more than a year after. Of course, his salary out of college was 4x what they were offering but can you imagine what candidate the government ends up with? The people who are still looking for a job in tech a whole year after graduation…
There are other things governments could do though.
Coming from a US perspective, the biggest one would be to pass some kind of law that employment contracts can't prevent you moonlighting for the government. I'd probably be willing to pick up some contract work to do on the cheap, but I can't because of my employment contract.
Another is that the government already has access to a lot of things I don't, and I'd be willing to trade my time for access to some of those things. Free flights on army cargo planes would be a great perk. I would totally do some work if they'd let me drive a tank for like 30 minutes and fire the cannon down the range a couple times. They probably have access to HPC clusters that would tempt some (I don't have the skills to have the interest, but I'm sure many do).
Government pensions are another option, although they'd have to require less than 40 hours a week of work to qualify. It might end up being more expensive than just paying more.
Tax breaks are another option. Someone would have to figure up the demand curve, but a 10% cut to my effective tax rate would be tempting depending on the amount of work required.
Free education would be another option if they could offer it for part time work.
I don't feel that the government has gotten particularly creative in trying to attract talent. The pay is bad, the job is a bureaucratic nightmare, and the perks kind of suck other than the pension.
The downside is that a lot of those are likely to piss off the rest of the government employees.