An “irresponsible and dangerous” drug driver who collided with other cars in an early morning crash has narrowly avoided being sent to prison.