Will Smith and Martin Lawrence are in the eagerly unawaited sequel “Bad Boys for Life,” but the star of the movie is Joe Pantoliano.

The Internet Movie Database reveals he’s been working all along in TV and video games but I haven’t seen Pantoliano in a decade and didn’t realize he was in “Boys,” so I was delighted when he popped up and slid easily into pretty much the same mouthy, good-humored whiner he always plays.

He can do a version of this guy that we can’t stand, as in “Bound,” and a version we’re unsure of, as in “Memento,” but he can also make him endearing as he does in “Boys,” in which he plays the boss who always advises renegades Smith and Lawrence to proceed with caution and who always knows they’ll ignore him.

For a sequel that comes 17 years after “Bad Boys II,” which was awful, “Bad Boys for Life” is surprisingly entertaining. It takes some time for the movie to settle down — specifically, for the leads’ chemistry to kick in — but eventually we are reminded how well Smith’s low-key smoothness plays off Lawrence’s scaredy-cat doofusness. Smith, I suspect, could do this role in his sleep but the early scenes find Lawrence trying too hard, like a stand-up who knows he’s bombing.

About half an hour into the movie, though, something clicks and, suddenly, you remember that there was a period when Lawrence was the world’s top comedian. I’m thinking, in particular, of a moment toward the end when the villains are about to get away, again, with the helicopter that appears out of nowhere, again, and Lawrence gets to say what we’re all thinking: “Where the hell are they getting all these helicopters?”

Directors Adil El Arbi and Bilall Fallah craft “Boys,” in which a mysterious crook (Kate del Castillo) swears to avenge herself against Smith, with a healthy awareness of its absurdity. They know they’re in the business of servicing whatever fans remain of a movie series Hollywood last visited when Billie Eilish was barely alive and they deliver exactly what you’d expect from a “Bad Boys” movie: snazzy cars hydroplaning on crowded streets, a high body count, striking cityscapes, massive property destruction, a crazy number of scenes set on that same Art Deco block of Ocean Drive that all Miami movies love, bad guys who are ripped and an elite squad of cops who seem to have been chosen mainly for their elite hotness.

Other than a great twist, there aren’t many surprises. But “Boys” was made not because someone thought there was another innovative story to be told but because someone realized Columbia Pictures had a piece of intellectual property that it could wring a few million more bucks out of (and, by the way, this movie obviously sets up another sequel).

It’s a formula, for sure, but “Bad Boys for Life” proves the formula still works.