The seventh-generation BMW M5 will introduce an electrified engine that delivers more punch with less pollution.