> impossible to write any meaningful piece of software without violating some patent.
Even if that were true, the existence of a patent shouldn't necessarily stop someone from infringing that patent. If a startup infringes someone else's patent and makes a profitable business doing so, then they have access to enough money to either fight the validity of the patent or pay a royalty. If the patentee is a non-practicing entity, then it would usually rather have some royalties than fight a lawsuit challenging validity, so there should be plenty of room to negotiate. If the patentee is a large company that wants to exclude competitors and refuses to license, the startup may have patents on improvements that the it could use as leverage in addition to the threat of a lawsuit. Such a dispute might end with an acquisition, which might be a nice exit for the startup.
The exception to this strategy would be patents that are likely difficult to challenge (e.g., foundational patents on new technologies or some drug or chemical patents). Most patents (including software patents) don't fall into that category.