A funny thing happened to Stephen Kessler on his way to completing “Paul Williams Still Alive,” his affectionate portrait of the diminutive dynamo who loomed improbably large as a pop-culture luminary during the 1970s. After serendipitously tracking down his childhood idol, and starting production on what he clearly intended — initially, at least — as a melancholy ode to a faded star, Kessler wound up forging an unlikely friendship and, in the process, making a richer, deeper and more idiosyncratic documentary. Pic could click with baby boomers and Gen-Xers in various formats, but nostalgia will be only part of its appeal.

For the benefit of those who tuned in late: Throughout the ’70s, Paul Williams earned fame and fortune as a prodigiously prolific songwriter, penning enduringly popular standards such as “Rainy Days and Mondays,” “We’ve Only Just Begun,” “I Won’t Last a Day Without you” and “Just an Old-Fashioned Love Song” for the likes of Three Dog Night, the Carpenters, Helen Reddy and, no kidding, David Bowie.

He wrote for movies (earning an Oscar for “Evergreen,” co-written with Barbra Streisand for “A Star is Born”), had success as a solo recording artist, and drew wide exposure as a film and TV actor.

Kessler covers all of this and more in “Paul Williams Still Alive,” and duly notes that, like all too many ’70s celebrities, Williams spent much of the ’80s and ’90s out of the spotlight while recovering from a personal and professional meltdown fueled by booze and drugs.

A TV-commercial director whose feature credits include “Vegas Vacation” and “The Independent,” Kessler immediately cops to being a longtime fan of his subject. He reveals that, as a chubby kid growing up in Queens, N.Y., he felt a special affinity with the borderline-elfin Williams and deeply empathized with the songwriter’s works about loneliness and longing.

When he fortuitously discovers that Williams still is alive and performing, Kessler has mixed emotions: He’s glad to see his idol survived his crash-and-burn excess, but a bit sad to see the former superstar now playing gigs in hotel lounges and lesser Vegas venues.

Williams, however, doesn’t see it as sad at all. There’s a fascinating dynamic at play throughout “Still Alive,” as Williams — sometimes politely, sometimes sternly — repeatedly refuses to fulfill Kessler’s expectations, and progressively prods the filmmaker into making a movie far different than the one he set out to make.

Early on, Williams convinces Kessler to be an onscreen participant, claiming that it would be difficult, if not silly, for him to pretend to be unaware of the camera following him. Later, when Kessler quizzes Williams about the low points of his ’70s superstardom, Williams bristles at the criticism implicit in Kessler’s queries. “I feel like this is a dig that I haven’t felt from you before,” Williams snaps. “And I don’t like it.”

It’s very much to Kessler’s credit, and to his film’s benefit, that he has included this and other scenes that depict him as trying too hard to fix his subject in some preconceived scenario, and Williams as instinctively resisting facile labeling. The two men don’t really begin to bond until they share a six-hour bus ride through a possibly terrorist-filled jungle during Williams’ tour of the Philippines. But the give-and-take between subject and filmmaker always is the pic’s primary focus.

Williams readily admits to often being a drug-addled show-off during his ’70s heyday — in one of the pic’s discomforting sequences, he’s visibly pained as he reluctantly watches video of his spoiled-child arrogance while guest-hosting “The Merv Griffin Show” — and he makes no excuses for savoring all the perks that came with fame. “To be different is difficult,” he says. “To be special is addicting.”

As Kessler himself observes, there’s a tension generated throughout “Paul Williams Still Alive” by opposite points of view: While the director is looking back at a life to make a documentary, Williams — who’s still living that life — is looking forward. But the combination of those viewpoints makes for an engrossing and satisfying pic, one that can be enjoyed even by people who have never before heard of its subject.

Tech values are satisfactory.

Paul Williams Still Alive

  • Production: A 3W Films presentation of a Mambo Entertainment production. (International sales: WME Entertainment, Los Angeles.) Produced by Jim Czarnecki, Stephen Kessler, Mike Wilkins, David Zieff. Executive producers, Robert Cohen, Lesa Lakin. Co-producer, Alicia Van Couvering. Directed, written by Stephen Kessler.
  • Crew: Camera (color, HD), Vern Nobles; editor, David Zieff; co-editor, Jonathan Del Gatto; production designer, Perry Andelin Blake; sound, Marcos Contreras. Reviewed at Toronto Film Festival (Real to Reel), Sept. 10, 2011. Running time: 84 MIN.
  • With: With: Paul Williams, Stephen Kessler, Mariana Williams, Chris Caswell.
  • Music By: