Hmmm. I wonder if the power button might be stuck down internally. Has the machine had liquid split on it at any point?
A simple suggestion to try first: exercise the power button a bit by pressing it firmly, say 20 times, to try and clean it out.
More scientifically, I think the easiest way to test for that possible cause would be to disconnect the power button. On some models, this is a separate connector. On others, I think it’s part of the keyboard connector.
Is this the white plastic MacBook (13-inch, Mid 2010), A1342? If so, I think the keyboard ribbon cable shown in step 14 here might be the right one: MacBook Unibody Model A1342 Logic Board Replacement - iFixit Repair Guide
It wouldn’t be necessary to follow all the steps in that guide - just enough to disconnect that connector. I think steps 1, 2, 3, 14. These connectors are very fragile - lots of care & patience required, and preferably a non-conductive nylon “black stick” “spudger”.
This isn’t a perfect experiment, though, because once that is disconnected, you then don’t have a power button to press to turn the machine on! (On machines with separate power button connectors, you can temporarily connect a different button for this sort of thing, but when it’s all mixed in with the keyboard, this is a bit more complicated.)
But if you disconnected the keyboard, reconnected the power, found the machine turned itself on, and continued to turn itself back on even after selecting Shut Down using a USB-connected mouse, you would have eliminated the keyboard as a cause… in that case, a likely alternative cause would unfortunately be a logic board fault.
I hope this makes some kind of sense!