I don't have any more Pentax gear, but I do have a Ricoh GR.

Although I have never had any direct hands on experience with the Tamron 17-50, I've seen plenty of images made with that lens and it is every bit as sharp as one would expect any decent prime lens to be. It is the one lens I regret not owning, mainly on account of owning almost everything else at that focal length.
I have owned a few different Pentax DSLRs and even the Q, which was a total delight. In some ways I wish I had kept the Q, but I had too much money tied up into other systems which were being ignored on account of the sheer pleasure I got from using the Q. Despite having 6 other cameras with bigger and better sensors with several thousand dollars tied up in lenses, the Q was my go to camera.
Long story short, the Q is what led me to the GR. I like small cameras. The GR has an APS-C sensor in a very small magnesium alloy body with a wicked sharp lens that fits into a regular size pocket. It isn't quite as much fun as the Q, but I liked it enough to part with all my other DSLRs and mirrorless systems except for my Nikon 1.
One thing I should mention is while your K5 is weather resistant, your Tammy isn't. In other words, you might want to pick up a WR lens if you plan on using your camera when it is likely to get wet.