Sounds like the DM needs to put their damn foot down
I'm awkward and quite bad at that normally but if my players have gone off topic for more than a minute I'll soft remind them to get back on track, another minute or so and I'll bring it up again, and if we've wasted 5 minutes I activate my autist mode and just straight up mention were way off topic once a spot opens, and refocus the game
That's part of the damn job, I can run a table with up to 10 people without too much of an issue as long as everyone actually comes with their GODDAMN CHARACTERS FINISHED, DAVE
There's a wide range between tpk and something interesting happening.
Like, the players are dicking around and can't decide how to ask the bartender if they can have access to the secret occult library in the basement. Just really spinning their wheels and being total PCs. Fine. Timer runs out. Their rival shows up, doesn't acknowledge them, says something quietly to the bartender and is being lead to the basement.
Ah, yeah. During combat there's the related "if you can't decide what you're doing in a minute, you dodge and we go to the next person" rule you can bring out.
I admit I've only played D&D once. We spent half an hour working out how to go through a hole in the ceiling when there was an unlocked door in front of us. I thought that was just part of the fun.
Long discussion about the game: fine, acceptable, fun!
Long discussion about the meaning of a French word from hundreds of years ago after your bard said the wrong thing in a talking puzzle: might be fun, but is unrelated to the actual game and should be cut short before it drags on
The DMs job is to control the narrative, if you're talking about the game at all then it's part of the narrative and you should really only push them if they start going in circles or something at that point