I find it helpful to try to quantify the time I'll enjoy with a thing before I buy it. Or maybe there will be some amount of cost savings if it's a tool. You could do both with a motorcycle.
Unless you get a shitty Harley, it will almost certainly be more fuel efficient than an ICE car/truck, so if you plan to commute by motorcycle at all, there is some cost savings there. That will probably offset the cost of registration and insurance, and maybe regular maintenance, so not really a net gain, but at least pays for itself to some degree.
So after approximating the cost after those savings, then you can approximate how many hours per year and how many years you expect to enjoy the thing for. Divide the cost by that number of hours. Would you pay that hourly rate for the enjoyment you expect to get from it? If so, buy. If not, don't buy.
There are obviously some abstract things to factor in too, though. Would you make friends through your motorcycle? Do you enjoy working on stuff so in addition to the riding do you plan on doing aftermarket work on it? Is there a bucket list aspect to this?
I can tell you that, as a former motorcycle owner, I would probably not get one again. They're super fucking dangerous, almost entirely because other drivers are fucking morons. It's impossible for me to ride without being on edge with the assumption that every other driver is actively trying to kill me. At this point, I would only get one as a fun time to ride once in a while, and the upkeep isn't worth it for that. Even an electric one would be hard for me to justify for myself because of insurance, registration, and ride gear.
That all being said, there are considerations that you and you alone will need to apply to this decision. I just strongly urge that if you do buy a bike, you wear all recommended gear. Never shorts. Never sandals. Never without a helmet and jacket. Dress for the slide, not the ride.
Excellent. Idk if you have deer or similar stuff in your area, but be very vigilant. If you lock up your rear tires and fishtail, just keep your tire locked. If you let off the brake while not perfectly straight, your bike will violently realign and you'll get bucked off.
Overall, I recommend these motorcycle safety courses to all drivers. It pushed me to be much more actively aware while driving.