There's a method to get into a new sort of government a bit earlier. i.e revolting before you actually know the desrired sort of gov. You can always make a revolt if you know at least one gov-tech except despotism.
During the anarchy, you would either try to finish researching the desired gov-tech on your own with scientist(s) or you could try to trade for the tech just before the anarchy phase is over (and hope for a drop in price during anarchy phase due to a civ selling around that tech meanwhile).
For example, in the first case, you could make a 40/50 turns run towards Republic. If you already know Monarchy, you could make a revolt before you finished researching Republic and complete the tech with one scientist during anarchy. Well, depending on expansion speed (and current number of cities in relation to the OCN respectively), it is (on standart maps) almost safe to make the revolt 3 turns before Rep is in. If you then get a (short) anarchy phase of 3 turns, you will first get the new tech choice prompt and then the gov choice prompt - Rep will be on the gov choice list immediately (just don't make a 'new' revolt after discovering Rep...). This method won't cut down anarchy length, of course, but you would leave out of despotism earlier.
If you have a fairly high amount of cities, you could try to gamble and make the revolt, say, 5 turns before the tech is in. There's of course some risk involved, if the RNG draws a 'good' number... (anarchy is over before the desired tech is in).
Or, if you have a lot of population, don't go for a min-science run @40/50 turns at all and finish the tech with a ton of scientists (3 beakers per scientists in C3C is not that bad). There's risk of losing pop due to starvation, so a TechCalc comes pretty handy here.
In the other case (trying to hope for a drop in price on the tech market), you just hope that a civ that knows your desired gov tech sells it around in time, thus cutting down the price. You would then buy it 1 turn before the anarchy is over.