So what I’ve been able to dig up on the Interweb generally states that the origin of the phrase is still uncertain though it probably came from hell in a handcart which I believe the earliest reference to is found in a 16th century stained glass window. It and its passive aggressive sibling, “heaven in a wheelbarrow” just seemed to be ways to tell people to go to hell in the most expedient way possible with no way to redeem themselves. However, there does seem to be quite a few people nowadays who believe it deals with beheadings as the head was commonly either caught in a basket or placed in a handcart/wheel barrow.