Based on Mohamedou Ould Slahi’s best-selling memoir, “Guantánamo Diary,” the new film “The Mauritanian” sheds light on the 14 years he spent at the prison. Playing Slahi is French-Algerian actor Tahar Rahim, who last week was nominated for a Golden Globe for the performance. Director Kevin Macdonald said Rahim took the role incredibly seriously and marveled how he may be one of the first times a Muslim character has been the empathetic lead of a mainstream American production. “The Mauritanian,” co-starring Benedict Cumberbatch as a Marine Corps lawyer and Jodie Foster as a defense attorney, is out Friday.