British Airways A320 G-GATL operating BA2667 Marrakesh – London Gatwick was climbing out of Marrakesh when crew needed to shut down the #2 engine after it emitted a loud bang. The aircraft returned to Marrakesh for a safe landing.