Not doing the optimized thing your class is designed to do violates the social contract. Paizo designed the game that you have no choice but to do it.
There are a couple of APs that are quite hard, but for the most part you don’t actually need to play optimized characters. If you do, then you are indeed locking yourself into a single way of playing and yup, it may well be very boring.
The social contract is not so much “you must be optimized” as “do something that helps the group”. You may have your go-to actions ready, but other helpful options are nearly always there. When you build a character, don’t mini-max three feats to get that extra dice of damage; instead look for other fun things to do.
Specifically, multiclass. Pick a class with utility ability where you aren’t trying to oppose peak enemy stats, pick up a class that can make monster knowledge checks, heal a bit, help people hide, summon annoying distractions … whatever is fun for you.
Take feats and skills that improve mobility, so you can get places and do fun things. Buy magic items that are interesting and fun, rather than maximizing damage.
If you are a good GM, you should have pretty darn good system mastery ability, so if you only choose 75% of options with minimizing in mind and 25% for fun, you will still be ahead of the curve in ability to contribute.
When I ran 4E and in PF2, I tell my players straight up: if you optimize your characters you will have less fun. It’s your choice, but it’s pretty consistent. Optimized characters are boring and create bored players.