SAN FRANCISCO — Most subjects of a festival tribute spin a few anecdotes while sitting back and basking in the general adulation. But Robin Williams, “interviewed” onstage at the Castro Theater as the recipient of the San Francisco Film Festival’s Peter J. Owens Award by his friend Armistead Maupin, instead delivered an hour-plus stream-of-consciousness comedy riff.“I knew this was going to be like herding cats,” said Maupin, who wrote the screenplay for Williams starrer “The Night Listener.” Nod is presented to “an actor whose work exemplifies brilliance, independence and integrity.” Prior awardees include Danny Glover, Dustin Hoffman, Annette Bening, Anjelica Huston, Ed Harris and Stockard Channing. Fest executive director Graham Leggat’s brief intro praised Williams’ “prismatic intelligence and whipcrack wit,” and both were on manic display after a clipshow that emphasized his more serious roles (“Dead Poets Society,” “Awakenings,” “Good Will Hunting,” “Insomnia”). During the course of an electric 80 minutes or so, Williams channeled Hanoi Hannah, Henry Kissinger, a Marin high school teacher on acid, Truman Capote, Stephen Hawking in space, Koko the gorilla, Strom Thurmond, Idi Amin, Marlon Brando, Britney Spears and the “Grim Rapper.” Asked who he’d like to work with, Williams imitated Scorsese, Nicholson, Polanski and Eastwood. Expressing enthusiasm for world cinema, he did accented takes on the general character of movies from a half-dozen nations. Recalling pre-stardom days (which included a stint as busboy at a holistic San Francisco restaurant), he defined 1970s San Francisco with the quip, “An addict is someone who crosses a line — and then snorts it.” He recalled accidentally breaking Robert De Niro’s nose while making “Awakenings”; his eccentric mother (“She came to the house one day wearing hot pants and a Harpo wig”) and straitlaced dad (whose advice on acting was “Just have a backup profession, like welding”). While professing enjoyment of his cartoon voice work thus far, he wasn’t answering to Disney on this night — the word “tits” was heard more frequently at the Castro than possibly in his entire screen oeuvre. Getting Williams to methodically discuss his career is no easy task — he repeatedly jumped up from his seat for off-the-cuff physical/vocal comedy. But Williams did provide a few sober thoughts. He’s traveled to Iraq and Afghanistan to entertain the troops, but regarding the current White House administration said, “I feel like we’ve been under some strange sort of medication” for the last six years. Praised for his warmth on-set (“If the lowliest grip was having a birthday, you would take 10 minutes to make a fuss,” Maupin said), Williams occasioned the earnest reply “If you start to treat people like shit, it will come back to you.” Speaking of his longtime Bay Area residency (his parents moved here in 1969), Williams called S.F. a “sanctuary.” His wife, Marsha “sometimes says it’s a bubble, but I say, at least it’s a happy bubble.” Williams also had fond words for his late friend Christopher Reeve, doing small movies where “the pressure’s off” and praise for the different directors with whom he’s worked. He said his tendency to riff improvisationally was tempered by talents like George Roy Hill (“The World According to Garp”) and Peter Weir (“Dead Poets”), the latter telling him “You don’t have to do anything. Listening is a powerful skill.” The evening ended with a screening of Terry Gilliam’s 1991 pic “The Fisher King,” in which Williams played a crazy but noble homeless man opposite Jeff Bridges’ disillusioned radio shock jock.