Depends on the jurisdiction. In TX it's ok to head to the shoulder to go around a left-turning vehicle. It's also advised for slower vehicles that are holding up traffic. It's in the code under "developed (or improved) shoulder". You can use it as an explanation to head to the shoulder to go around a block and take the next exit but you may have to explain it to the judge if you go around and get back on (without exiting). I've had good experiences doing it but be careful as some angry cagers may move to block you. Also watch out for flat-creating detritus that gets pushed to the shoulder.
545.058 section 3 (to take the next exit - or right turn because NY sucks), 4 (to go around), 5 (to let others go around), (and possibly 7)
https://www.statutes.legis.state.tx.us/DocViewer.aspx?K2DocKey=odbc%3a%2f%2fTCAS%2fASUPUBLIC.dbo.vwTCAS%2fTN%2fS%2fTN.545%40TCAS2&QueryText=developed%3COR%3Eshoulder&HighlightType=1
Sec. 545.058. DRIVING ON IMPROVED [Previous Hit] SHOULDER [Next Hit] . (a) An operator may drive on an improved [Previous Hit] shoulder [Next Hit] to the right of the main traveled portion of a roadway if that operation is necessary and may be done safely, but only:
(1) to stop, stand, or park;
(2) to accelerate before entering the main traveled lane of traffic;
(3) to decelerate before making a right turn;
(4) to pass another vehicle that is slowing or stopped on the main traveled portion of the highway, disabled, or preparing to make a left turn;
(5) to allow another vehicle traveling faster to pass;
(6) as permitted or required by an official traffic-control device; or
(7) to avoid a collision.
The last time I looked it up, there were more (supporting) references in the code elsewhere. This time, I felt this was a good enough start for anyone wanting to do more research on their own.