Bear with me... this will take some "explaining" without being able to do a drawing and point to it.
It is an idea not mentioned above.
Before I start, let me say that I like the "drive an alternator with the bike, measure power produced by it" answer... better than my answer! Could someone please address the "but it would count power produced when bike free-wheeling" problem? I suspect it isn't really a problem, but can't quite say why.
So... my alternative answer....
It all started with an exercise bike I sometimes ride. It has an adjustable brake, to make riding it easy or hard.
The brake doesn't work exactly like this, but essentially it does, and what I am going to describe can, I think, be adapted to provide information on power.
In the first place, the "tire" on the bike isn't like a road bike's tire. It is turned by the pedals, but the "tire" surface, that which would touch the road in an ordinary bike, is metal, and flat. Flat and at right angles to the main dimension of the wheel. And about two inches wide. So the wheel is more like a train wheel without the flange, if you see what I mean.
Now, the brake:
The brake consists of a rugged strap. One end is fixed to the bike's frame, then the strap wraps around the wheel, and the other end connects to a spring which connects to a different point on the bike's frame. You can change the tension in the spring. The tighter the strap is held against the wheel, the more friction, the harder it is to pedal.
For my idea to work, you would need the spring to be at the "uphill" end of the "U" of the strap around the wheel. The harder you pedalled, the more the spring would be extended. Only slightly more, but the difference would be there.
If you measured the DIFFERENCE in the pull on the frame by the spring between when the wheel were at rest and when the wheel was turning, you would have a measure of the force the cyclist was exerting to overcome the friction, wouldn't you? And you would count the turns of the wheel, throw in the circumferance of the wheel and you have a distance "travelled" Force x Distance = work??
If you didn't want to use a strain gauge, you could, I think, with some "amplificaton" by means of cable and pulleys, measure the slight change in the spring's extension, and calculate the force from that?
As I said... I think the alternator is the way to go!