It would not take "billions" to fix the simple stuff like the near-useless wifi and connectivity and charging. Perhaps 100k... I've run an electronics design and mfg company for 40+ years.
I think the lack of sales is due to multiple factors. The biggest is that phones do an increasing chunk of photography. You can't fix that. It is here and cannot be stopped. Well, Pentax could go back to little retro-style film cameras for hipsters, with leather shoulder straps
I think that fashion, the beards, etc, will die out within a few years, but there may be a bit of money in it for a bit.... maybe not though since there are tons of these old cameras on Ebay, and these people just carry them mostly for show.
The areas which can be addressed are the usability features. WIFI transfer etc is really a low hanging fruit.
Lots of companies with a "fanatical" following have had problems moving forward. Look at Apple. When their fanbase heard that Apple went to the IBM PC (80x86 processor) architecture, they went berserk, over the abandonment of "traditional Apple values". I hate this expression but sometimes you have to crack some eggs to make an omelette, and if Pentax if to survive as a player they need to move forward and come up with some stuff the others (similarly constrained by their fanbase) don't have. Pentax will never compete with Nikon and Canon in their traditional "pro" playgrounds; they need to do something different.