Second is where your customers are. This is both a tax question (you want to pay less tax) and a business question (you want to collect more money more easily).
If you need Stripe or its equivalent, you dance to the tune they play. Organize in the USA and bend to their will.
If your customers are in the USA you have to look at whether you have "U.S. source income" -- a defined technical jargon-y concept. If so, it doesn't matter where or what you (or your company) happen to be. The U.S. wants tax.
You have to look at brain damage, complexity, and cost. Don't focus so much on financial cost when thinking about your business structure. Think about opportunity cost. An hour spent thinking about this is an hour you did not spend writing books or marketing them.
Until the stakes are high -- several million a year of revenue -- don't get too complicated. Yeah Apple 'n Google do fun stuff. But they have billions of dollars and you (and I) don't. :-)
Keep it simple. Don't optimize for tax too early. You'll make more in building your business fast than you will spending the same amount of time and thinking on tax strategies.