I would not go for a camera, that does not supportthe latest lenses which is KA4, i.e. aperture by wire.
That rules out the K-5 in both variants.
Thus you can choose between three lines of Pentax cameras. Which are all in your price range.
I suggest you compare them with the tool allready linked by asylum fox.
Top-level: K-3, K-3II - in your price range available used
Upper level: KP - available used or new if you add some bucks
Budget line: K-S2, K-70 - the K-70 is available new within your price range, the K-S2 might be available as some new old stock
Let me repeat: K-70 and KP are in your price range or close it new.
All those cameras are way better then your beloved K-r in every aspect.
Things to consider beside the price tag.
- Solenid - The K-S2 and the K-70 depend on solenid and are thus canditates for a failure. There is no hint they are overprone, but hey you never know. Despite that I bought a K-70 in 2019 and coming from a K 10D I am very happy with it.
- IQ - All those cameras have outstandig image quality, you won't complain coming from the K-r. The differences are small steps and goes upwards starting with the K-S2 then K-3, K-70, KP. Main difference is ISO behaviour and jpeg engine.
- Other technical standard - The K-70 (and KS-2) uses the technology of the K-5, next level is K-3 with a better AF module and the K-3II adds built in GPS. The K-3s are built for the eternity as well. The KP has still better AF (a bit).
- Handling - The K-S2 and the K-70 are in line with your K-r with the addition of features only the top cameras had in their time. Pentaprism and second wheel. You should feel at home. The K-3 has more knobs, no scene mode and is not so menu depending, better to use I would say one step up from the K-r, but if you are happy with the handling of the K-r... The KP follows the same philosophy as the K-3 only completely different with its third wheel. Some people do not likle the changable grips, some love it (I do, feels like a P-30). K-S2, K-70 and KP have an articulate screen, the one of the KP only for horizontal pictures really usable.
Bottom line.
As you come from a K-r I would suggest the K-70 if there wasn't the selonid issue, which is a very minor issue, but it is one. You would get the camera you are used to, only much better. With an fully articulate screen and top noch image quality.
My second choice would be a new KP - if you can strech your budget a bit. I think the used are not much cheaper and warranty in mind ...
If you want to know how the top line handles and want a real endurable camera with best technology, the K-3 is yours. If you can get one on a real bargain, then you might even buy an additional lens.
And please note, all of these cameras will be a real threat to your old lenses, even without pixel-peeping. So, if you still use a 18-55 dial in the 18-135 at least
(or a Tamron 17-50/2.8).