We all know electricity can kill. AC and DC do act a bit different, but once you exceed 60 milliamp in your body, thing can go very bad.
AC with ground fault protection is actually quite safe now. Modern ground fault breakers can shut off a line before you even feel the shock. Without ground fault protection, AC can and will still hurt or even kill. I have had my share of bad shocks, and it is no joke. The big lesson I learned was to not be afraid of it, but to respect it. Know the danger and take proper precautions. If you are going to be working on a high energy system, have another person around that can shut off power or kick you free of it. Even with all the precautions, something can happen. Obviously do as much of the work with the power turned off as you possibly can. But when working on solar panels and batteries, there is no off switch. The most recent shock I got was a momentary lapse of judgement. When I was assembling my first house battery bank, I was wearing latex rubber gloves. At 48 volts (57 actually) the gloves were enough isolation that I could handle the wires as I was connecting up the bus bars and balance leads. But after working for 2 hours in 95F heat, I was getting pretty sweaty. My fore arm brushed a buss bar, and it made my whole arm tingle pretty hard. It was not to the level of what I would call pain, and it didn't lock me up, but it was an extreme wake up call that I needed to be a lot more careful around these things. And that is nothing compared to the 400 volt (or more) you could have coming from a series solar panel array. Even in heavy overcast, the voltage could be way up there. Sure, they won't make much current if it is overcast, but remember, it only takes 60 milliamps in the wrong place to cause big problems.
There is not easy fix for the battery bus bars, but most areas are now requiring rapid shut down on solar modules. The whole array should not put out more than the voltage of a single panel when the system is in shut down. 40 volts may give you a decent shock, but nothing like the 400 volts from a whole series string.
DC certainly has a few more ways it can be dangerous at the same voltages. The biggest issue is electrical arcing. DC can strike up and hold an arc far easier than AC. And because of this, most areas are also now requiring DC solar arrays to have arc fault protection now as well. A loose AC connection can strike up an arc, but it does not take much for it to go out. A DC arc at the same voltage can cross a much large gap and stay burning much longer as a bad connection burns away. A crack in a solar panel can become an electric arc that gets hot enough to shatter the glass and start the back sheet on fire. The 40 volts of a single typical solar panel is far less likely to be able to do that, but when you put 10 in series, that arc can now hit 400 volts and keep it burning.