As a foreigner you can buy real estate in Panama. A tourist can buy it. Anybody can buy it. There are no restrictions, no laws, and no difference whatsoever.
If you were a resident with a visa here, you would be treated in the court of law in the same way as a citizen. But if you’re just a tourist and if you brought stuff here and a case is brought against you, you’re still treated fairly but you’re not treated on the same level.
I wouldn’t buy property that was untended, leave it for a year and then come back and find out that a mess has occurred. If it were a condominium in a project, leaving your property unattended is not a problem, but if it’s just buying a piece of land somewhere out in the middle of nowhere or a standalone home that has been deserted for a year or two, then that is poor form; that is something else.
If, for example, some poor family from Costa Rica or somewhere that does not have a place to stay sets up a tent on your land, you can get them thrown off when you come back a year or two later but you have to go to court to do it and the judge is going to look at you and say, “The only reason you bought that land is to make money. You don’t care about the country. You don’t want to live here. You ignored it, you neglected it and here’s a poor family that has no place to stay.” So yes, you’re going to get your land back but it’s going to take you four, five months in court and all your legal expenses. This is not common; once in a blue moon. However, I would recommend using common sense. If you’re going to buy a place here in Panama and walk away from it, make sure that somebody’s taking care of it, keeping an eye on it while you’re gone and who can represent you in case any question ever arises.
But you don’t have to be a resident to own land in Panama or property and you don’t have to be a resident to run a business here. You can run a business, you can set up a corporation, and you can do whatever you want to. Most people who do these things are residents but we do have people who have been here several years on tourist visas or while they are waiting for their regular visas (that could take some time), they can still operate their business.