When a film is set in the make-’em-laugh world of improv comedy, you might think the emotional tone is going to be lighthearted, even bawdy. That’s just a thin slice of “Don’t Think Twice,” which steers us into very different terrain.

Mike Birbiglia, the writer/director and one of the leading members of the ensemble cast, delivers a surprising, bitingly honest drama entwining strands of blood, sweat and jokes. While it seems like fun and games to the audience, any glimpse at comedians backstage reveals a punishing connection between nerve-racking work and a vulnerable private life.

Set among a six-person troupe of small-time New York City performers called the Commune, the movie is funny, but also remarkably touching. It feels realistic, with dialogue resembling unrehearsed, unstructured conversations.

It gives us shrewd explanations of why people become comedians (an odd mix of self-love and self-loathing) and what it takes to survive in the field (a frugal lifestyle and a knack for turning raw gut punches into punchlines). Great creative abilities help, but they’re no guarantee of success.

The Commune’s stage team is also a hive of cutthroat competition. They’re not just stalled in trying to move up to larger venues; their little stages are trying to close and become more lucrative businesses. Almost all of the comedians hope to leave obscurity and become a new cast member of the network late-night hit “Weekend Live.” When one does become a household name overnight, that newfound fame can be shared with the others only in limited quantities.

Birbiglia, a popular stand-up for more than a decade, understands the profession well. He knows where the ambition, frustration and jealousy have been hidden. As one of the characters says, the members spent their 20s hoping about their futures, and their 30s watching those showbiz dreams pass their expiration dates.

The group’s struggling frenemies are played by actors with charismatic screen presences. Some are well known, such as TV comedy stars Keegan-Michael Key and Gillian Jacobs, stunningly good playing it straight as onstage partners in an iffy ongoing romance. Some are less familiar (Kate Micucci, Chris Gethard and Tami Sagher as their quirky performing colleagues). Unexpected big stars play themselves in secret appearances.

Importantly, every character here is fully three-dimensional: cranky, angry, yet intuitive and empathetic. Humor is used not simply as laugh-a-minute entertainment. It’s a bittersweet coping mechanism for painful realizations, even a tragic personal loss for Gethard’s character. Their running joke breaks his heart into even smaller pieces, then starts him laughing, and healing.

This comedy is painfully honest and deathly funny. These are insecure people trying to find acceptance from strangers in each night’s audience and workable relationships in the real world. Each one’s role is relatable.

Well, except for the network TV show’s self-congratulating fat-cat producer, whose speech patterns sound a whole lot like Lorne Michaels of “Saturday Night Live.” In Birbiglia’s fine, insightful film, there are cases of arrested development in the limelight and the executive suite, too.