Global number of publications over time
I found an archived version of the 2018 STM Report, which is now available directly from STM again. Among other statistics, it has this plot of the scientific output from 1975-2018 and four different databases:
The Web of Science (WoS) line looks rather similar to the earlier results of Bornmann and Mutz (2014), who produced this figure for 1980-2012 using a copy of WoS' database:
arxiv.org presents his own statistics, but be aware that a lot of publications from humanities and biomedical sciences are missing in this statistics:
This chart also shows the exponential trend on arxiv.
Long-term chart:
Very long-term chart:
There is also biorxiv covering the missing biomedical scientific branches, much younger than arxiv but there is a quite detailed statistical report on its growth.
Publication: Attention decay in science (due to exponential growth)
(To me it's also interesting how this correlates with the number of PhD students in another answer and how this can be explained... did internet boost scientific productivity and/or number of PhD students?!)
For the field of mathematics, another source of data is the AMS Math Reviews (MathSciNet), where this type of information is readily available (just search for the year you want). Virtually every reputable math publication gets indexed there nowadays. Also, unlike something like Google Scholar, only reputable journals get indexed and each publication appears only once. Math Reviews is a paid service, so you'd need to be affiliated with a university with a subscription. (I don't know how complete this data is as you go further back in time. Maybe someone else has a better sense of this.)
For example, here are the total number of mathematics publications for various years at 10-year intervals.
2018: 111,018; 2008: 99,268; 1998: 67,807; 1988: 55,420; 1978: 36,637; 1968: 19,615; 1958: 10,249; 1948: 5,456; 1938: 1,417; 1928: 1,439; 1918: 632; 1908: 729; 1898: 710; 1888: 266; 1878: 181