Here's what I found:
Taxation of Nonresident Aliens – International Tax Gap Series | Internal Revenue Service.
Nonresident aliens are generally subject to U.S. income tax only on their U.S. source income. They are subject to two different tax rates, one for effectively connected income, and one for fixed or determinable, annual, or periodic (FDAP) income that is non-effectively connected income.
Effectively connected income (ECI) is earned in the U.S. from the operation of a business in the U.S., as well as personal service income earned in the U.S. (such as wages or self-employment income). It is taxed for a nonresident at the same graduated rates as for a U.S. person.
However, found this as well and looks like there's a withholding
https://www.irs.gov/individuals/int... with the,subject to withholding under FATCA.
Generally, if you are not a partnership, you do not need to withhold tax on ECI income (income which is effectively connected with a U.S. trade or business) if you receive a Form W-8 ECI on which a foreign payee represents that:
The foreign payee is the beneficial owner of the income,
The income is effectively connected with the conduct of a trade or business in the United States, and
The income is includible in the payee's gross income.
The W-8 ECI must include the payee’s U.S. TIN.
Income effectively connected with the conduct of a trade or business in the United States is not a withholdable payment under chapter 4 and thus is not subject to withholding under FATCA.
Income from work done inside Panama is technically taxable in Panama. So your C Corp pays taxes in the US and should pay taxes in Panama as well, as there is no tax treaty between US and Panama and Panama doesn't apply tax credits without a tax treaty.
However, it's unlikely Panama would seek to tax the company nor your income from it, so long as you don't give them a reason to (i.e. you're a societal nuisance).
If you want to go above and beyond, though, you could rent an office in the US and even hire a US resident to do work for the company.
https://taxsummaries.pwc.com/panama/corporate/corporate-residence
Panama Corporate - Corporate residence
A company is considered as a tax resident when it has been incorporated in Panama and if Panama is regarded as the place where the central management is located.
Entities incorporated abroad may also be registered with the tax administration in order to avoid WHT.