> Even if Israel could limit the damage in the long term, it doesn't seem politically viable to just tolerate repeated attacks with no response. So I think it's inevitable that Israel will have to remove Hamas from power, no matter the geopolitical cost.
This is an odd gripe. Israel is perpetrating repeated attacks in the West Bank, every single day, and the Palestinian Authority as well as the vast majority of Palestinians in the West Bank have been tolerating repeated attacks for decades now. In fact, it is perfectly possible to tolerate repeated attacks with limited response, and there are many examples of countries tolerating low-impact attacks for a very long time with little response.
Preventing Hamas or a Hamas-like group from existing is not possible as a matter of reality, not as a matter of geopolitical cost. Israel already tried the whole occupation thing, and it only meant more attacks. The only way to remove Hamas from power, without them being replaced by not-Hamas-in-name-only, is to convince Gazans, for a second time, that peaceful coexistence is possible, and to actually give it a shot this time.