ImplicitCAD (ExtOpenSCAD) Cloud

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

Console