Until this week, the government repeatedly rejected the notion of a windfall tax on oil and gas companies, which have been reaping huge profits from sky-high energy prices.

But the chancellor, Rishi Sunak, hinted at a possible U-turn on Wednesday, telling Mumsnet that such a policy was “never off the table”, and would be looked at if investment by companies in Britain’s energy security failed to materialise.

The idea is that the money raised could be spent on easing the cost of living crisis for those households most under pressure from soaring prices. So what would a windfall tax on oil and gas companies be worth to the Treasury?

Labour has repeatedly argued that a one-off, year-long windfall levy could raise £1.2bn to fund discounts on home energy bills, which are already at a record high of £1,971 for an average dual-fuel tariff, with a further eye-watering rise on the way in October.

The party has proposed levying an extra 10% on the corporation tax paid by oil companies that are active in the North Sea. This would be on top of the 40% rate they pay on their profits, already higher than the 19% headline rate of corporation tax.

This would not only affect well-known firms such as BP and Shell but also lesser-known ones such as Harbour Energy – which actually produces more oil from the North Sea than any other extractor: about 163,000 barrels a day last year.

The sector’s big firms have certainly done extremely well out of the high oil and gas prices that have sent energy bills and the cost of filling up a car to record highs. BP made a profit of £10bn last year, admitting it has “more cash than we know what to do with”. The company was a “cash machine”, its chief executive, Bernard Looney, said – around the same time as dismissing calls for a windfall tax.

Shell did even better at £15bn, after record quarterly earnings in the last three months of 2021. Both companies will report first-quarter figures next week, including any boost connected to the war in Ukraine.

On Wednesday, Sunak appeared to leave the door ajar for a levy – but one that would penalise those oil firms that fail to do their best to help the UK squeeze more drops out of the North Sea.

“What I would say is that if we don’t see that type of investment coming forward and companies are not going to make those investments in our country and energy security, then of course that’s something I would look at and nothing is ever off the table in these things,” he said.

It is not immediately clear how the government would set the criteria for judging which companies are underinvesting. In practice, forecasts of increased investment in the North Sea suggest very few firms, if any, are likely to be penalised under current circumstances.

Spending in the North Sea is forecast to hit £21bn over the next five years, according to a report published last September by the UK oil trade body Offshore Energies UK, a higher annual rate than the £3.7bn of investment in 2020.

Habour Energy, which produces a fraction of either BP or Shell’s global output, increased its spending on new and existing projects from $556m to $640m last year.

It plans to increase its spending further this year, indicating it would be unlikely to fall foul of any penalty for perceived underinvestment.

Shell is already considering a U-turn on its decision to abandon the Cambo oilfield, which lies about 75 miles north-west of the Shetland Islands.

The company said this month it planned to invest £20bn-£25bn in the UK energy system over the next decade, although 75% will be on offshore wind, hydrogen and electric vehicle infrastructure, rather than North Sea oilfields. But it too is planning more extraction.

“We plan to continue to invest in the North Sea,” BP said in its latest annual report.