Okay, the code is now almost done, all that remains is the bit to calculate exactly how much of an impulse each raycast applies.

Notice that the big C-shaped object has 20-something raycasts... this is because of a maximum-angle parameter.
I ended up doing something a little more involved than originally planned. Here's some details:
After locating the max and min angles of each shape within range, I put all of these values (both min and max) into an array and sort the array based on angle. I may change this to only include the min/max values for the b2Shapes, though this could introduce incorrectness if you have any bodies made up of shapes that aren't "connected".
Then I do a ray cast (using b2World::RaycastOne) in the direction of each midpoint in the resultant angle-sorted list of boundaries. This means exactly two raycasts are performed for each b2Shape. What this allows for is if a long object is partially obscured by a shorter object, it will result in the long object having more than one angular "segment" on which to apply forces (because the smaller object has blocked a section of it). For segments that are adjacent but raycast to the same shape, we know that the shape is continually exposed to the explosion point along that edge, and can then treat the two sections as one later on.
There is some weird stuff done on the edge case (the boundary between -pi and pi radians), but its simple enough.
Then for each "segment" (I used a std::vector to buffer these), each of which represents a projected angular cross section that belongs to a single b2Body, we figure out how many raycasts to do on it based on parameters such as:
- maximum angle between raycasts
- minimum angle from edges of segments to beginning and ending raycasts (and a ratio associated with this)
- minimum number of raycasts on any one segment
then we do the final raycasts, this time just using b2Shape::TestSegment on the appropriate shapes. Since I grouped the segments according to which b2Body they belong to, this does involve looping through all shapes in the relevant body.