> Additionally, for some time now, it is possible to set up a Peruvian company as a foreigner (be aware that you need a Peruvian (silent) partner who owns a small percentage), then employ yourself as the general manager, get your contract approved and apply for a work visa.
Looking at the different types of company available:
https://www.gob.pe/254-tipos-de-empresa-razon-social-o-denominacion
one of the options is Empresario Individual de Responsabilidad Limitada (E.I.R.L.), which is basically a company that consists of a single person.