I found in Twitter a great question related to Open Data SE. Maybe someone knows anything more.
Does anyone know of an estimate of total public expenditure from governments around world?
This question is hard to answer. There is no database providing a single figure. However, there are some international databases which provide the information for individual countries.
If you want a good coverage of countries, try the Worldbank's Public Sector Statistics. Scroll down a bit and click on the Databank Button. For some countries the data is missing. Either they don't have this kind of information or they don't want to share it with the public.
Eurostat has quite complete and good quality data on government expenses. But obviously, you will be mostly limited to the EU.
The OECD has a wider geographic coverage. On their statistics site, you will find the data in the "National Accounts" Section:
Individually, you could use the CIA World Factbook.
Under 'economy' there's 'budget' and then 'expenditures'.
I don't know if there's an API for searching it, but I believe that Wikipedia sucked it all out to populate their initial country entries. (but I don't know the schedule that they've been updated, or if it's consistent)
Adding to previous good answer, I think that you might find useful the following WDI indicators (http://data.worldbank.org/products/wdi):