Something with constant aperture which would make Manual Mode and really any exposure mode, easier. Disclaimer: All my lenses are constant aperture and zooms.
A used
Pentax DA 17-70/4 is very affordable, versatile and you get a little more reach so good for portraits. Just very good IQ and a bargain.
As suggested the
Tamron or
Sigma 17-50 2.8 give also you more speed and constant aperture vs the kit.
If you can live with a narrower bottom end, an inexpensive, used
Tamron 28-75/2.8 is a very versatile lens, good IQ and also good for portraits.
None are weather proof so if that's important, it's back to Pentax WR stuff which would include the 16-50. The Pentax 50-135/2.8 is a very, very good lens, my workhorse portrait lens.
You can save a lot of money buying used gear from reputable sellers. UsedPhotoPro and KEH typically give 180 day warranties. B&H and Adorama are also honest folks and Amazon is good with returns. Also high rated Japanese sellers on eBay are a good source as Pentax is a big brand in Japan, lots of gear there. I've bought from all for years and have yet to have an issue. Also lucky to have a good, local camera store, a real one, not the display at Best Buy. Mine will match B&H price on new and I've found lots of good used gear there. And they are very patient with beginners so maybe look around.