The GPL has no power that owners of proprietary code don't already have. The GPL is a software license under copyright law which grants certain permissions subject to certain conditions. If you don't fulfill those conditions, standard copyright law takes effect.
The GPL does not on its own have the power to "infect" the rest of your codebase. You can absolutely decide you want to distribute GPL'd software compiled in with proprietary software for which you don't want to release the source. The owner of the GPL software still does not, at this point, have any right to your source. All they can do is say, since you have not obeyed the conditions, you don't have a valid license for my software, and I am now ready to sue you for infringement.
You can resolve this situation by relicensing the proprietary components under the GPL and distributing source, if you'd like. GPLv3 has an explicit provision that says, if you do this within 30 days of being notified of the problem, the license retroactively does apply to you and it wasn't infringement. Many major GPLv2 rightsholders have voluntarily adopted the same condition for their GPLv2 code: https://gplcc.github.io/gplcc/
You can also resolve the situation by settling with them out of court, going to court and paying damages, going to court and arguing it was fair use / de minimis / whatever, trying to buy them out, etc. If you're willing to do any of those, then you don't have to release your source. (If you go to court and lose, you will probably be ordered to not further distribute the GPL'd code in violation of the license.)
None of this is specific to the GPL. If you use proprietary code without a license at all, the rightsholders can still sue you. You can still negotiate with them. You can still fight it out in court. The rightsholder can even choose to say, "Hey, you know what? If you release the entire source code to your product publicly, we'll drop this case." They have the ability to negotiate that with you because that's the same ability GPL rightsholders have.
GPL is considered "viral" because, for most people, releasing the rest of your source code is preferable to losing in court for regular copyright infringement. With proprietary software, if it's found out that you've misused someone's code, they probably will not offer you that viral option - they'll go straight for the monetary damages. If you don't consider that fatal, then you shouldn't fear that situation with the GPL, either.