There's a lot of old wives tales about bears. While food does attract them, and you don't want one in your camp, it's extremely rare to be attacked in such a situation. Likewise, we always talk about a mother and cub, and not wanting to get between them. But attacks are extremely rare in that situation too.
By extremely rare, ALL bear attacks are extremely rare, but the above types are rare even among bear attacks.
Most bear attacks are lone, large males, and predatory. They aren't curious or protective. They weren't caught off guard. They simply want to eat you. Such a situation is indeed rare, but it's how most bear attacks happen. Being aggressive towards them startles them, and that's GOOD. Prey animals try to run away. Doing so reinforces that you are prey. Other predators challenge them, and most of the time they decide it's not worth the effort. Sure, they'd win. But they might take an injury or two in the process.
That's why they tell you to get big and loud like krayfish did. I don't walk through the woods singing, and if I see a bear I don't shout at it. I'm just not that fearful of them. But if one knows I am there and is still approaching, yes, I hope I have the presence of mind to act aggressive as well.
A bear who clearly sees you yet still approaches slowly. That isn't curiosity. It's thinking about whether you are food or danger, and hasn't made up it's mind yet. When it does, you will quickly find out what it decided, as it will either make tracks towards or away from you.