I assume these are black bears? Does your friend have the option of running the bear-attracting compost through chickens or pigs before the bears can get at it? The chicken litter or hog manure can then be composted, along with any carbonaceous amendments, as required.
Bears are generally a seasonal nuisance by us - spring and fall, mostly. A dog in the yard can help, since bear hunting is legal here, and bears learn pretty quickly that dogs mean hunters. Juvenile bears may not have received the memo, though. Even a small dog, but with a good yap, is a pretty good bet, here. We had a Jack Russell terrier who barked at the mere presence of oxygen. She was also a big dog trapped in a little body; nothing much phased her - not bull mastiffs, not draft horses. She also had a small tank, if you get my drift, so there were many (many!) outings in the middle of the night, no matter the weather. She was happy to spend her days patrolling the perimeter - unless there was a ball to be chased! It may be coincidental, but we never had bears around our yard until after she passed on.
Making a compost enclosure actually bear proof seems like a difficult proposition, though perhaps not impossible. Welded steel and/or poured concrete sound like reasonable choices, to me. Bears are incredibly strong, curious and determined. If they want the off-cuts of your over-ripe honeydew melon, then good luck trying to keep them from it. At least, that's been my experience. I once saw a cook stove that had been rolled around and knocked apart, with castings scattered over 10 square yards or so of upland northern hardwood forest. Reading the tea leaves, someone had probably thrown the last of the bacon grease in the firebox at the end of deer camp, and taken down and packed up the wall tent. The cook stove was left in the woods until next hunting season, being too heavy to easily move from its remote location, and the bear had subsequently wrought its handiwork to recover the vestiges of breakfasts past. Even if all of the parts and pieces were recovered, I am doubtful that the stove was ever the same. Possibly, wasn't even usable. At least, not without some nickel welding rod and a rosebud torch tip. And, I've heard of bears peeling the plywood sheathing off a deer camp shack to get at whatever was inside, breaking the ever-so-slightly-rolled-down driver's window out of a Jeep station wagon to get at the bag of dog food on the back seat, pushing a window out of the wall of a substantial, well-built modern house (i.e. 2X6 stud wall, not log - but I don't know if that's germane) to get inside for a casual look-see, and more.
An electric fence is worth a try, for sure, but even the deer are pretty handy at punching through an electrified fence, in these parts. A bear feeling gaunt in the spring after a long winter's nap, or stocking up for this coming winter, may not be much deterred by an electric fence if you have something sufficiently interesting on offer.
Jerry Kobalenko, Canadian high arctic adventurer and photographer, and author of "Horizontal Everest" (about spring camping on Ellesmere Island, opposite the northwest coast of Greenland), has used an auditory alarm trip wire fence for polar bears. Though the loud noise emitted by the alarm may spook a curious bear (hope springs eternal...), he admits that the main thing is that he'll wake up when the bear crosses the established perimeter, rather than when the bear is dragging his sleeping bag from the tent, with him still bundled inside. He carries (or has carried) a 12 gauge pump action shotgun as "bear repellent", though as I recall, he's only had to fire once, and that just ended in the bear high-tailing it, none the worse for the wear, and a bruised cheek for Jerry due to a poor shoulder mount for the hastily fired shot. Whether a shotgun is the best choice in a bear confrontation is debatable, but it demonstrably can be sufficient, you could certainly do worse, and in many jurisdictions a shotgun is treated more permissively than other classes of firearms.
Jerry describes the fence in some detail in "Horizontal Everest" and a bit in this blog entry, as well:
https://jerrykobalenko.com/expeditionsarchives2014.htm
Someone DIY'd a version, here:
https://www.thingiverse.com/thing:1452016
I haven't been able to track down any details on Alfred Duller's original version of the fence, on which Jerry based his design. Alfred was pulled out of his tent by a polar bear in no fewer than three separate incidents over a span of about 30 years, as described here:
https://insideclimatenews.org/news/01122014/chapter-3/
(Ctrl+F to find the Duller encounter relevant description).
Jerry's version shrieks until continuity is manually restored or the batteries die. But, his alarm fence needs to be light and compact for his expeditionary style, and must run off battery power in cold weather (down to -40C -even -50C - early in his spring trips, is not unreasonable). Some design decisions have been made in the interest of simplicity and robustness under difficult circumstances (i.e. setup while wearing mittens).
I'd think some combo of noisemaker and flash strobe would be worth a try, especially if, unlike Jerry's alarm, it was self-resetting - maybe one of the timed motion-activated LED lights could be co-opted to flash and make a racket. After the timer shuts it off, it could be ready for round 2, even if you aren't at home "on the day of visitation".
None of the above options are mutually exclusive, so you could combine them as you see fit (including implementing exactly zero of them!).
Not sure if any of this is actually helpful...