The 12 gauge slug has been used to kill every species of animal on this planet at one time or another.
It is NOT the preferred weapon for many of the larger species, however although there have been failures, there have also been some successes. It is considered a good last-ditch defense weapon.
It needs to be pointed out that with a large tough animal of greater than 300 pounds, the always found in Walmart and similar places, hollow (Foster) 12 ga slug is not really what you will want. Those are primarily designed for deer. They can kill the bear but there are enough tales of under penetration that you probably will wish to avoid the experience.
You will be seeking a 12 gauge slug designed for maximum penetration, not expansion. Leave the buckshot at home. Unless it is a contact wound over a vital organ you will probably regret using buckshot on an angry bear.
There are several approaches for assured penetration with a shotgun. The oldest one was a solid lead ball (used in BP shotguns, called a pumpkin ball, fairly inaccurate, but quite effective under 20 yards).
In today's world I would look for Brenneke slugs (much more accurate and nice deep penetration). If you couldn't find them, then with the understanding it will be a smaller hole in the animal I would look for Discarding Sabot shotgun slug ammo. They usually fire a .50 sub caliber round often of hour glass shape. BRI makes some. There are also some solid steel slugs made by a Russian firm called Tandems, but I have no experience with them.
In the days when people routinely culled critters that wanted to eat them a standard trick was to first destroy the animals shoulders from a distance. The theory being a 4 legged animal suddenly down to only 2 legs moves more slowly which gives you time to aim more carefully. I really don't see a bear presenting you with a legal 150 yard shot (especially if they aren't even in season). Most states laws would require you to just find another route and avoid the animal. At 25 feet I wouldn't waste time on that technique. Sheer momentum would probably put the critter on me or you. Bears can be unbelievably fast when they think their life is at stake.
In America, 90 times out of 100 a black bear seeing a human will go the other way. Exceptions include, bears used to humans because some moron intentionally fed it, a momma bear protecting cubs (which you may not see), a bear who feels trapped (possibly because there are other humans nearby creating a feeling of being surrounded), a bear who has already been injured and who is full of adrenalin, territorial dispute (is that his deer you just killed? Let him have it). Adrenalin fear will make a bear charge you and usually his intent is to knock you down and keep going (this is where people playing dead have a chance). Adrenalin anger is a whole 'nother story. He will kill you if he can, and rip your corpse into the tiniest pieces he can (playing dead is of no value in that situation). Watch the documentary series 'Grizzly Man' especially the list few minutes of soundtrack. I would describe that (unusual, but inevitable) ending as a mix of a territorial dominance dispute and resulting Adrenalin anger.
Understand that in the last 100 years many armed hunters on foot have been killed or mauled by bears even after they shot it. Sometimes both bodies have been found at the same location. I used to have a friend with some deep furrows carved into his cheek (and the bone underneath) still there years after he 'killed' the bear. What you are proposing could go either way.
Second issue. I very strongly suggest taking some of the exact same slug ammo you are planning to use and the exact gun you are planning to shoot to the range together. Do a few slow strings of 5 shots through the pump onto a posted target of 25 yards or so while you are standing to get used to it. Now do the same in rapid fire as fast as you can work the pump.
Check the gun. I strongly recommend the shorter slug barrels, hopefully with fiber optic front sights. I have seen many pump actions that can nicely shoot all day with bird shot and occasional buckshot, develop serious problems when they encounter the rapid firing of slugs. If the gun is okay, score your target, then do another string of rapid fire. check target and gun.
IMO, you are not ready to do your experiment if your group size at 25 yards while standing, in rapid fire, exceeds 6-9 inches. Likewise, if small screws and pins you never noticed before have backed out of the gun, or internal parts have sheared, get them fixed, loktite what needs loktite, then do it all again.
An average leopard is smaller than an average full grown black bear. Just last year I read multiple accounts of separate incidents in which the leopards sudden attacks required more than 2 shots of 12 gauge through the chest before they ceased an attack. One didn't stop until the 4th shot into it's mouth blew off the back of the skull. I also read about an incident of one crawling off into the brush (to die) after thoroughly mauling the soldier who emptied his AK into it.
My point is large carnivores are dangerous. I try very hard here to keep at least 100 yards between me and any bear. I avoid them and they avoid me and my house. It works just fine. I have the capability, but I also acknowledge they have capabilities too. Many hunters who hunt bear do so from a stand. Being 20 feet above the animal gives you some advantage. Being on the same plane makes things more equal.