Do you have to screw flat pedal pins in all the way, or can you make them longer by leaving them screwed out and using a thread locker?
There are many designs of pedal pins. Some are tiny bolts coming through the pedal body and fixed by nuts on the opposite side, some are instead screwed directly into the pedal body, into blind threaded holes, and some have flanges to control the depth on insertion. Some are seemingly pressed into the pedal body without a possibility to be replaced.
A few of many existing designs are shown on the pictures below.
It is often possible to buy replacement pins that are physically longer so that when installed, they protrude more from the pedal surface.
Other designs, mostly "screw through", may allow to install a shim on the opposite side, thus making the pins shorter (not longer).
For those designs where pins are screwed directly into the pedal body from the "front" side, their incomplete threading makes them protruding more. However, fewer threads will hold them in place. It will incur higher risk of losing pins but also damaging their threaded holes in the pedal body, making installation of replacements problematic. I would not recommend doing so, and instead would seek for longer aftermarket pins.
Finally, longer pins are only needed to get better grip on the soles. Instead of changing the pins, it may be worth trying to increase the grip of the shoes instead. There are many inexpensive MTB-specific shoes, whose grip on pins is much better than of e.g. running shoes.