Inside a $21.8 million San Francisco mansion with an eclectic history of residents