Changing the flywheel won’t affect the power 1 iota. Not in strict terms at least.
The flywheel is a simple energy recovery medium. You have to perform work upon the extra mass accelerating it up to speed but this is stored as potential energy.
Thus motocross bikes have light flywheels for aiding acceleration & woods bikes gain more benefit from being to tap into this resource of energy making the bike less snappy & bitchy & prone to stalling etc.
Imagine a dentist drill, accelerates instantly to silly speeds but easy to stop. A heavy drill will spin you wrists around if it bites at an inopportune moment.
Depends on how you use your bike to what weight flywheel you’d prefer. PS when in gear the clutch, gearbox, wheels & tires form their own flywheel effect.