Government funded open source is certainly one possibility, and one that people like RMS favor to some degree, if I understand them correctly. Governments do fund plenty of other public goods (using the definition from economics: https://en.wikipedia.org/wiki/Public_good ). There are plenty of problems with this approach too, though.