Credit Hilary Swift for The New York Times WASHINGTON — President Barack Obama and his wife, Michelle, who have spent the past few months slowly figuring out the rhythm of post-White House life, have taken some time to invest in local real estate: They just spent $8.1 million to buy the mansion they’ve been renting in an exclusive neighborhood here. Last May, the Obamas decided to lease the 8,200-square-foot Tudor-style mansion in Kalorama, a Washington neighborhood that has long been home to diplomats, lobbyists, politicians and the occasional spy.