So where in the hell did all the money come from? I
Basically it was uncovered deficit spending with government debt against the Reichsbank.
In part by creating fake financial instruments like "Mefo bills"
https://en.wikipedia.org/wiki/Mefo_bills
A lot of the publicity-effective infrastructure measures were not much more than symbolic. For instance building the autobahn system did not actually employ that many people. (It was useful though in terms of military movements)
In January 1939 the Reichsbank criticized the "completely undisciplined spending spree that is bringing state finances to the brink of collapse and endangers stability of the currency", obviously the central bank leadership was replaced.
Basically if there had been peace, the Nazi regime would have suffered an economic collapse... but it was never intended as a system that would work in peacetime. It was all geared toward a big smash and grab moment and "once the war is won money will not be an issue". There was no sound economic policy.
The Weimer government mostly turned a blind eye to Berlin's huge sex scene. This is undoubtedly because the scene brought a lot of foreign tourists to the city, and of course, their cash. Did the cash from the sex scene play a major role in funding the Nazi war machine?
Err, absolutely not, it was a miniscule amount and the Nazis didn't control it. The usefulness of the Berlin sex scene for the Nazis was mostly in propaganda terms...
How did Germany, in a mere 20 years or so, manage to build the huge war machine that it did, given the awful economic circumstances of the country at the start of that period? All those tanks, U-boats, and so on had to be paid for, right?
Several things to consider here ... the democratic governments of the Weimar era also considered the restrictions placed on the German arms industry illegitimate and there were a number of clandestine development programs, sometimes including foreign partners such as the Soviet Union.
Germany's industrial base hadn't been destroyed in WW1. And due to the rapid advances of basic technologies, the turnover rate of military equipment was very quick. For instance fighter planes designed in say 1924 were practically useless in combat by 1939. The kind of tanks developed at the end of WWI were also useless in WW2. In comparison nowadays arms platforms that are 40 to 60 years old still serve in upgraded form, and the top of the line US air superiority fighter today the F-22 had its maiden flight 30 years ago.
So everyone was turning over their military hardware at a high rate, but also in very high numbers. If you had your industrial base, and Germany did, it was possible to arm up quite quickly.