MUonE, muon $g-2$ and electroweak precision constraints within 2HDMs