I had the same issue, on a keyboard which is no longer used very often. I used domestic appliance descaler (concentrated acetic acid, I think) to disolve the worst of the gunk as in finddarkpoet's first picture. Then I clamped a large flat-blade screwdriver in a bench vice, and unscrewed the battery cap by turning the keyboard as KWVarde suggested, using brute force & ignorance (plenty of ignorance). The batteries were stuck fast. I drilled a small hole in the negative terminal of the first battery, then used a corkscrew to get it out. That was messy, although it came out in one piece! The second battery was free to move, but would not come out past the residual gunk on the inner bore until I scraped it off (using a dental pick to clear the threads, and a small file to scrape clear the bore). The innermost end of the battery tube looked OK, as did the positive contact at the bottom of it. I used the file, pick, and fine emery cloth wrapped round a pencil to clean up the bore, finishing off with a detergent soaked rolled up kitchen towel and a final drying stage. The inside bore near the battery cap looks a right mess, but it is clear of all potassium hydroxide residue.
The bluetooth module cover removes by squeezing the sides of the plastic tube together, which allows a jeweller's screwdriver to get under the rear edge and gently lever it up. Everything within was clean and shiny. I used a bit more of the appliance descaler to clean the screw-in battery cover, and the dental pick to scrape the thread in the aluminium body clear so it would make contact. Once everything was dry, I fitted 2 batteries and screwed the cap in. I checked the supply voltage inside the bluetooth compartment using a DVM (negative terminal is the Philips screw, positive terminal is the coil spring (bottom of finddarkpoet's first picture) and got about 3.6V which is OK. I did not find it necessary to remove the electronics module or disconnect the flex cable from the PWA (fortunately).
It took about 15 minutes after inserting the batteries before I was able to pair the keyboard with a Mac - I don't know why. I took the batteries out & put them back in a couple of times during this period, trying to get it to work. Eventually one of the 'power on' button presses gave me the green LED and we were operational.
Thanks to all the posters on this thread: I was about to put the keyboard in the WEEE bin for recycling before I tried one last Google search!