How are workshops hammers more "efficient" than whipping hammers?
Also Slavery is enabled ages before workshops ever become something other than a -1F, +1P terrible trade thing.
Kinda got me confused there.
For the moment I'll focus on a very simple question - when are workshops more efficient than farms for production?
I start by noting that generally you want your cities to be at their happy-cap, so your most
efficient whipping is when you're bumping pop up to happy cap, then whipping 1 pop away and losing 1 happy cap for 10 turns.
It's possible to do some fairly easy apples-to-apples comparisons for this. For example: If you replace 1 farm with 1 workshop before Code of Laws, you lose 2 food and gain 1 hammer. This means workshops are preferable if the food -> hammers conversion from slavery is worse than 2F -> 1H. In point of fact (assuming you have a granary), your exchange rate is: 15F + 1.5F/city size + 10 lost worker-turns due to lower happy-cap (which is equal to 10 lost food from not working a farm) -> 30H. In order for workshops to be stronger, you'd need a size 24 or larger city. Because it's... let's call it uncommon... to have a size-24 city before Guilds, workshops tend to be weaker than farms in total production before Guilds.
You're free to go do the comparisons yourself for all sorts of other cases, but I've gone ahead and done most of them. The results are fairly clear. Ignoring weird cases (like cities that are over size-24 before Guilds, under size-3 after Caste System, or under size-7 after Biology)...
Farms are better than Workshops before Caste System.
Workshops are better than Farms after Caste System if you aren't Aztec.
Farms are better than workshops in Caste System but before Guilds for Aztecs if their average city size is less than 7.
Farms are better than workshops for horizontal Aztec empires (average size <14) who are not in Caste System, not in State Property, have Biology, and have The Kremlin.
However, there are five other major factors which have to be considered - three of which favor workshops, and two of which favor slavery.
First, the ones favoring slavery.
It allows for explosive production at the cost of lower efficiency. You may end up giving up a total of 140 hammers of production to get a cannon, but get that cannon right away instead of 5 or 10 turns down the line. You could even whip a size-14 city all the way down to a size-4 city in rapid order, using your citizens as stored hammers to get a massive military force assembled quickly. It's horrendously costly (you'll probably have paid for every unit twice over in lost production by the time your economy recovers), but it can be decisive. If you expect to be drafting a lot of units and whipping a bunch of cannons shortly, it might not be a good idea to start switching over from farms to workshops as soon as you get Guilds. Similarly, it lets you whip out a "panic" unit if you suddenly see an enemy near an undefended city, or whip out that initial granary and/or monument which help a city get going when first settled if you don't have chops available.
Food-based production also ties in better with some common early-game situations: cities which need multiple to grow up to size quickly don't need to have all their farms replaced with workshops (wasting worker-turns), and cities making settlers and workers are more efficient relying on farms before caste system, and about as efficient before guilds.
Second, the ones favoring workshops.
The biggest is that it lets you run Caste System, which makes paying upkeep and grabbing beakers much easier and gives you much better GP farms. It's often the case that there's a minor production lull between early catapult warfare (or earlier) and Liberalism, in which production (while still important) is not
as important as tech rate - simply because all the good land is already taken, and war is horrendously costly. In that case, you can rely on a few workshops to supplement minor production needs while mostly just hurrying your tech pattern along to Lib.
The second one is that the "ideal" whipping I mentioned earlier (whipping down 1 size, then growing back up over the next 10 turns so you're always at happy cap) is simply not practical a lot of the time, particularly for larger-ticket items. If you end up whipping away 3 sizes, and take 15 turns to grow them back (one every 5 turns), workshops are actually a more effective means of production
before Caste System for cities with happy caps above 10.
The third one is that slavery production is fundamentally capped. You can't sustain more than 3 hammers per turn from a city (raw; a forge can push that up more) for any significant length of time from slavery unless you're Aztec. If you have an early empire with very few hills but lots of river and grass, you may not be able to get enough hammers out of slavery to handle your basic production needs, in which case you
have to start setting up workshops.