The Mad Men actor would play David's nemesis in the untitled improv-based film, with David playing a character based heavily on himself, Showbiz411 reports.
Greg Mottola (Superbad, Paul) is set to direct from a script developed by David and his fellow writers from Curb Your Enthusiasm and Seinfeld.
Hamm has recently been cast in a Sky Arts drama opposite Daniel Radcliffe.
He recently revealed that prior to Mad Men, he was told that he would never be a television star.
Hamm's new film Friends With Kids is released on June 29. Watch a trailer below: