For a couple of months things have been looking pretty bleak on the Iranian front. Many observers seem to be gripped by a deep pessimism — a feeling that Israel and the US are locked on a trajectory towards war with Iran, which everyone accepts would be a disaster but nobody seems to know how to stop.

The background is a report released in November by the international atomic energy agency that gave increased credence to the claims that Iran is on the way to developing nuclear weapons. The evidence for this conclusion is still fairly thin, but when it comes to Iranian intentions, western countries, rightly or not, have gotten into the habit of assuming the worst.

Hence the fresh sanctions against Iran introduced by the US and the EU in the last week — and also a glimmer of hope on Friday, with a statement from president Mahmoud Ahmadinejad that Iran “is ready to sit down with world powers for talks on its alleged nuclear ambitions”. A new IAEA team arrived in Tehran at the weekend “to start with a dialogue”.

Sanctions do sometimes work; worldwide sanctions against South Africa are generally seen as having made an important contribution to the fall of apartheid. But they are at best a blunt instrument, and most of the time their effects have ranged from negligible to horribly counter-productive.

There is also an unfortunate tendency for sanctions to be imposed as a knee-jerk response, without clear thought about what they are intended to achieve. Like law-and-order policies that are driven by a desire to punish criminals rather than a desire to reduce crime, sanctions are sometimes the product of dislike of the offending regime, independent of any calculation of how they might serve their purpose.

In the Iranian case, there has been a discernible difference between the American and European approaches. The Europeans have conceded all along Iran’s right to develop nuclear energy for peaceful purposes and have focused simply on stopping the (alleged) weapons program. The US seems more set on stopping any nuclear activity and even on promoting regime change in Iran (although there’s no particular evidence that a democratic Iran would be any more tractable on the issue).

But there’s one sense in which sanctions do often work: they are an alternative to war, and their very availability can stop what would otherwise be a slide into open hostilities. Sanctions against Italy in the 1930s didn’t do anything for their ostensible purpose of saving the Ethiopians, but they were quite effective in achieving what was probably Britain and France’s real purpose, namely staying out of war. Hence it’s been suggested that Israel’s recent sabre-rattling has in fact achieved its purpose by forcing the West into tougher sanctions and that the threat of actual military action has therefore receded.

If so, however, the effect may be only temporary. The US is heading into a presidential election where the Republicans seem bent on global war against Islam, and even assuming they lose the administration may well be pushed further in that direction. Their goal is not just regime change (there’s been plenty of that in the Middle East recently), but specifically regime change imposed by American arms. One candidate, Newt Gingrich, has even suggested that Turkey (an American ally) is a terrorist regime; he would certainly not be showing any favours to Iran.

As for Israel, I confess defeat; while we should always try to interpret the actions of governments in terms of their rational motivations, Israeli politics seems to have moved beyond the point where that is possible. Imagine an Australia with Pauline Hanson as foreign minister and you have something of the flavour of what the world is dealing with.

No one wants Iran to have the bomb, but opinions differ widely about just how great a problem it would be. If there really is a weapons program, it seems overwhelmingly likely that its purpose is defensive: having seen what happened to Iraq, the Iranians want to have a deterrent on hand to avoid a similar fate. The world could probably live with a nuclear-armed Iran, but in view of the nature of the Iranian regime and the instability of the region it makes sense to prefer not to.

So even if the chance of a compromise settlement seems slim, it needs to be grasped with both hands. The chance might not come again.