What people forget in their arrogance is that unions also just bring more leverage back to the table to fight off abuse, setup better conditions, etc. Yes, they can be abused and yes, they can lead to stagnation but without collective bargaining power your only leverage is how easy/difficult you are to replace and how abundant acceptable (e.g., do I need to uproot my life?) competitive or acceptable openings are at any given point of time so you can vote with your feet.
It's perfectly OK to embed your idealistic meritocracy within a union as part of your negotiations. You don't have to appease the lazy and 'medicore' if that's your great fear, you can negotiate and codify fair evaluations for these things if your union so wishes this. At the same time you also can negotiate nifty things like: not being on call, not working overtime, making sure theres adequate number of engineers on a project, improving the type of work you do, etc. Unless you're leading a startup where you're on the other side of the table, I don't see how these ideas aren't appealing to you--the opposite is very appealing to your employers.
In general, labor has been on the losing side for decades and there's this degree of condescension that "I am professional making great TC, I don't need those piddly unions" mentality that does nothing but props up continued erosion of standards and expectations of work and compensation in this industry. I've been working in software and tech for quite awhile (my mentor who shared their experiences of such declines since the 60s), and I can assure you it's gotten worse over the years for workers. This industry has been mostly fortunate because of growth outstripping supply that continues to give some leverage, but that may not be the case indefinitely and if that happens, unless you are near the absolute top of the field, you too will continue to see declines in working conditions in this field indefinitely.