ImplicitCAD (ExtOpenSCAD) Cloud

linear_extrude (height = 40, twist(h) = 90*cos(h*2*pi/40))
  difference () {
    shell(2) circle (10);
    square(x=[0,20], y=[-4,4]);
  }

Console