Electric vehicle maker grapples with increased competition and blowback from Elon Musk’s political activism