Obama talked about the language differences in front of an audience in Southeast Washington D.C. recently:
If you look at Michelle, she grew up South Side (of Chicago). And her mom still lives in a neighborhood where gunshots go off, and it can be rough where Michelle grew up. But she’ll talk proper when she needs to. Now, you also don’t want to get on her wrong side, because she can translate that into a different vernacular.
Obama has a different vernacular too. (See Luther, Obama's inner angry black man).
The brilliance of the 'Key and Peele' sketch above is that the audience is racially mixed and we see both Obamas. A formal, "how are you, nice to meet you," one for whites and then the "what's up fam?" for African-Americans. Hilarity. In Key and Peele's imagining, yes, all black people do know each other and Obama kind of is the President of Black America.
This code-switching thing, is not without its perils though. Think back to 2012, when the October surprise was a video of Obama at Hampton University in 2007 talking about Hurricane Katrina and racism, remarks that inflamed conservatives.
What's most interesting about this video is that at times, Obama sounds positively Hillary Clinton-esque as he tries to mimic the cadence and speech patterns of black southern vernacular.