Step down 9-36V to 5V: Best and cheap way to power a Raspberry Pi
Given you want to accommodate a 4 fold range of input voltage and a minimum input voltage of 9v on a small footprint  linear regulation is a non starter due to high power dissipation.
You should take a look at buck converters since they can accommodate the voltage ranges you mention and convert to 5v with high efficiency and less waste heat. The standard rpi4 psu is rated at 3A.