A Commonwealth Avenue penthouse in Back Bay covering more than 3,700 square feet has sold for close to $10 million.