Or just go to a 40 minute countdown clock that the fourth official operates during matches (with a simple click of a toggle button), making any distraction or abuse of the fourth official an automatic yellow, with a second yellow and sending off for a second offence (never understand having a go at the fourth official, anyway, as it has never changed anything). Would not be difficult at all to coordinate timekeeping with the stadium system—it is already done with numerous other sports around the world.
The referee at lower levels without a fourth official can track time via their watch (not actually a big change from what should be going on in the current system).
That would make it nearly impossible to waste time, apart from what I see is the acceptable way via skill in keeping the ball in play and away from the opposition, or for referees to manipulate added time (as it will be blatantly obvious if they are not properly stopping the clock when the ball is not in play for whatever reason).
It will also add to the drama of the game as everyone can see (or feel) the known time remaining ticking down, with the final whistle when it reaches 00:00, regardless of where the ball is. For instance, one of the few things I like about basketball is the “buzzer beater”, as it adds quite a lot of excitement, with no feeling of “the referee is playing until their favoured team scores”.
Imagine such a change would be very difficult to get past the likes of United or Liverpool, though. And the league would probably have to be forced kicking and screaming in to doing it.