Have the USSR adopt "Green Revolution" technology the same way that the USA adopted it and exported the GR to third world nations during the 1950s and 1960s.
GR required massive investment in petroleum, tractors, fertilizers, pesticides and specialized breeding of plants.
That's pretty much what the Soviets did OTL. Only they did it with their typical efficiency, which meant large scale wastage of fuel oil, fertilizers, pesticides and herbicides.
The lack of efficiency was caused by a lack of education in the rural workforce and the typical Soviet mentality that if a problem existed, the way to fix it was to throw more resources at it.
What should have changed to prevent the famines?
The best way to avoid the famines in the 30s and 40s would be to have a good transportation network, a stable and effective government and a strong industrial sector that could sell manufactured goods abroad in order to get the cash to import food.
The most resource-efficient way for the Soviets to get the food they needed is to turn farmers into industrial workers and make the money to import food in modern factories.
Climatic factors mean that the USSR will always experience more bad years than the US does, so the state needs to have the ability to respond to bad weather ruining the crop in a region.
What do you think the maximum population of a Soviet Union with highly efficient agriculture would be?
Efficient in what sense?
As I've said above, the most efficient approach for the Soviets was to replace farms with factories and import what they needed. If the Soviets had cut their (really massive) agricultural subsidies and instead invested the same resources into industry, then agricultural output would have declined a little (but only a little, since most of what the subsidies were buying was wasted) and industry would have been far more modern and able to compete on the world stage. (There is a myth that the Soviet economy was crushed by the weight of run-away military spending - this is quite false - rather it was food and agricultural subsidies that experienced run-away growth.)
If the Soviets are pursuing autarky, then it won't be as efficient as spending the same resources on industry, so less efficient in absolute terms. It could still be made more efficient than the OTL Soviet Union by encouraging the Kulak class so there is a Soviet equivalent of the entrepreneurial small farmers that helped make British and American agriculture so effective. The rest of the peasant class won't like this, but they should be forced into the cities anyway, where their labour can be efficiently used working in factories or services. The Soviets shouldn't try to copy the British diet and should accept that the heroic working class will only be able to eat meat once a week (at most). Instead, land used to grow animal feed should grow human feed. Less wheat needs to be grown and instead crops like rye in the north (particularly rye, it is perfect for the Soviet climate), quinoa in the wheat belt and maize in the south should be grown. Nixtamalization should be introduced into food processing industries to effectively unlock the full nutrient potential of the maize. More root crops of all kinds should be grown. Some support by the state to help spread poly tunnels for raising less hardy vegetables might help as well. And of course, the Soviets need to stop growing cotton in central asia - the climate in the region is no good for cotton which is a big part of why the Aral sea was turned into a giant catastrophe zone. Raising the right mix of nuts and fruits would be a better fit for the region's climate and would improve the overall selection of foods across the USSR.
As far as the maximum population... That's a hard question. The Soviet Union probably couldn't support more than 170-200 million or so on its own agricultural resources if it had Western European levels of meat consumption. If Soviet citizens ate mostly vegetarian diets you might be able to support 500-800 million with the steps outlined in the above paragraph.
With a POD no later than 1900, how effective could Russian Empire/Soviet Union (whichever one works for the scenario) agriculture become? With what reforms? What maximum population could be supported by a Soviet Union with highly developed agriculture?
I don't think there's any plausible PoD that could lead to either the Russians or the Soviets adopting an efficient form of autarky. I reckon the best chance for "efficient" agriculture is for the Soviets to continue to focus on developing the cities after WW2 and to open up to the world market more. It means life in the Soviet countryside wouldn't improve so much during the Khrushchev and Brezhnev years, but it would also avoid ruinous subsidies and lead to a more urbanized USSR with more competitive industries.
In such a scenario, Soviet agriculture would be a little less productive (but far, far more efficient) and be able to supply MOST of the Soviet Union's food needs while the rest was covered by imports.
fasquardon