We can do it with geometry nodes if you want:
You're basically talking about conversion from rectangular to polar coordinates, which gives us an angle and a length for each vertex. You're just multiplying your angle by your length (the angle, as radians, bakes in the pi factor.)
Note that in order to do this, we need to rip an edge of the cylinder. That edge needs to be at the exact -X (in object space) of the object. We're basically turning two circles into two line segments; circles don't have ends, but line segments do. In this particular case, I've given the rip some actual extent. If we don't give it actual extent, that face will turn into a doubled up face on the backside, as we interpolate from vertices at nearly -180 degrees to those at nearly 180 degrees.
There's another option, but it will require us to mark one edge of our rip:
Here, I've hidden a row of faces, so you can see which side of the ripped edges gets the vertex group. Then I create a corrective factor for this "side" of the cylinder (subtracting 2*pi from the angle.)
Of course, after doing this, you can apply the geometry nodes, make a copy and join as shapes, or just leave them live.