Jeremy Corbyn shouldn’t fall into the trap of giving Boris Johnson an election. Unless, that is, he is pretty confident of winning it and, on the basis of the latest polls, Labour needs an election like a hole in the head.

Instead, the leader of the opposition should try everything else to foil the prime minister’s devilish plot to crash out of the EU without a deal. With the help of a cross-party group of MPs, he can probably succeed.

Labour has made conflicting noises about whether it would call a vote of no confidence in Johnson when the Commons returns on 3 September. This might well fail because most Tory MPs opposed to a no-deal Brexit aren’t yet ready to chuck out their own government. Corbyn’s credibility would then be knocked and it would be harder to stitch together a cross-party pact.

However, it could be even worse if the vote of no confidence succeeded. Johnson’s righthand man, Dominic Cummings, might get to carry out his undemocratic threat to delay an election until after we’d left the EU on 31 October. Even if he didn’t, the Tories might squeeze the Brexit party and win the election with less than a third of the popular vote.

A better plan is to pass a law to force Johnson to ask the EU for extra time so we can hold a new referendum, something our friends in Europe have indicated they would grant. The choice in such a “people’s vote” would be between the crash-out Brexit the government wants and staying in the EU.

To pull off such a plan, MPs opposed to no deal would have to secure the parliamentary time to introduce such legislation. They would then have to get a majority of their colleagues from across the political spectrum to back it.

‘Dominic Cummings might get to carry out his undemocratic threat to delay an election until after we’d left the EU on 31 October.’ Photograph: Peter Nicholls/Reuters

Neither task is trivial, but the stars are aligning. Even before Johnson became prime minister, more than 40 Tory MPs, including the former chancellor Philip Hammond, rebelled to stop him suspending parliament. Since entering Downing Street, he has further enraged sensible Conservatives. More now think that, if they have to pick their poison, they would choose a referendum rather than an election – and either of those rather than crashing out.

It’s only if parliament can’t pass legislation – perhaps because Johnson uses dirty tricks to stop MPs getting enough time to debate it – that Corbyn should call a vote of no confidence. Such a vote would presumably be held in October and the circumstances for a successful outcome would then be more promising than a premature one in September.

For a start, moderate Tory MPs would be mad as hell, really scared and know there was no alternative, so Labour would be well placed to win the vote of no confidence.

What’s more, Corbyn might be able to become a caretaker prime minister and call a referendum, as the shadow chancellor, John McDonnell, suggested last week. Even if the Labour leader couldn’t persuade enough opposition MPs to back him in a vote of confidence, it might be possible to form an emergency national unity government whose only task was to ask the EU for enough extra time to hold an election.

But what if at some point Johnson himself just calls an election? Well, under the Fixed-term Parliaments Act, he needs two-thirds of all MPs to vote in favour of such a snap election. That means, if Corbyn says no, we won’t go to the polls. And so long as a new referendum remains a viable way out of our political crisis, he should just say no.

• Hugo Dixon is deputy chair of the People’s Vote and chair of InFacts