What about a Fuji GFX 50R or a used GFX 50S? They are exactly the same sensor format as the old 40 MP CCD backs, with s modern CMOS sensor, and you can get a new 50R for $4000 right now. Or, for that matter, a 24x36mm camera over 40 MP like a Nikon Z7 (or D850), Sony A7rIII, etc.? Any of them, in either format, will have significantly better image quality (in general) than the old 40 MP CCD backs - even cropping a modern 24x36mm sensor to 4:3 to match the shape will give you nearly 40 MP (starting with the 46 MP Nikon), and each pixel is enough better than the old CCDs that the overall image should be better...
The CCD backs were at their best at base ISO (often 50), and really fell to pieces by ISO 400 or so. The Nikons capture some of the low ISO magic of medium format, although not the sensor size or shape (they go to ISO 64, and they're utterly noiseless at ISO 64), while offering modern high ISOs as well. I've seen varying opinions about whether the Fujis' lowest ISO is a true ISO 50 or an "L" setting (does it increase or decrease dynamic range?), but the Fujis are awfully nice at ISO 100. Either a Fuji GFX or a Nikon/Sony pixel monster will give you really usable ISOs up to 6400 and beyond as well as pristine low ISOs with huge dynamic range like the old backs had.
The 40 MP backs are 2010-era cameras built when the exotic Nikon D3x and Canon 1Ds III (around $7000-$8000, and 22-24 MP) were the next step down, and nothing much else was >12 MP. They were more or less obsoleted by the D800 in 2012, and completely obsoleted for most applications by the 50 MP medium format CMOS sensor and the D810 (which brought really low ISO to high resolution 24x36mm) a few years later.
Unless you need something really unique (a relatively inexpensive body to mount an HTS adapter, or a back to go on a view camera with an Hasselblad H mount if they exist), I wouldn't pay more than $1000 or $2000 at most for a pre-CMOS 40 MP Hasselblad. Since the Pentax doesn't have any of the 'blad's special flexibility with adapters, I wouldn't pay more than $800 for one (you can get a nice used D800 for that, and a D800 will make a better image in most situations).
The only case where a CCD camera makes sense (unless there's some unusual quality to the image you want as an effect) is some of the later generation 80 MP backs at low ISO. They really are lovely, and nothing short of a GFX 100 or a modern CMOS Phase is going to match them at ISO 50. They're also still very expensive (about $10,000 right now).
Unlike the GFX 100, they're very close to full 645 frame size. Those may become bargains for certain types of images (studio work, architecture, landscape close enough to the car that you're willing to carry their associated camera) if the GFX 100 pushes their prices way down - they'd be very interesting around $5000, because they offer higher low-ISO IQ than a GFX 50 or any Nikon or Sony, but with less ISO flexibility and convenience. They're also very flexible for view camera use, and could provide an interesting option with movements..