I suggest you consider the FAA's guidance on these issues before deciding on what course of action you would take in event of an engine failure after takeoff or an inadvertent IMC encounter. AOPA also has a number of excellent videos about the inadvertent IMC encounter. In any case, if you were in VMC and inadvertently enter IMC, a 180-degree turn back to VMC is what all the authorities recommend as the first option. This is why that maneuver is taught and tested as part of Private Pilot training and certification testing.
What creates fatal accidents is either continuing on or being unable to safely execute the 180-degree turn in the weather. If you can't do the one, you certainly cannot do the other. Anyone killed by losing control while trying to execute a 180-degree turn isn't going to have a snowball's chance in hell of surviving continued flight in actual instrument conditions. And if you can't do that 180-degree turn on the instruments, you need some refresher training from a CFI on the basic instrument tasks required by the Private Pilot-Airplane ACS. Ask for some of that on your next Flight Review -- and it should be part of that review even if you don't ask.
BTW, as a CFI, I have trained many people on both the 180-after-takeoff and the 180-after-IMC-entry. But in both cases, you do NOT want to be doing it the first time for real. If you want these to be tools available in time of need, get trained on them now, and practice them in the future.
The level of risk is a function of the pilot's knowledge and skill. If you have studied the maneuver, learned it under the tutelage of a knowledgeable instructor proficient in the maneuver, regularly practice it at a safe altitude, and can discipline yourself not to attempt it when the necessary parameters are not met, the level of risk is minimal. OTOH, if you have merely heard or read about it, and try it for the first time by yourself in the actual event of an engine failure, we'll probably read both the accident report and your obituary.
In summary, while landing straight ahead or off to the side may be preferable in many or even most cases, in some cases there are no options ahead, and the turnback may be your best option if you have the necessary speed and altitude as well as the skill and proficiency to execute it properly. The only way that happens is if you do what it takes to make this a viable tool in your flying tool box, and that starts with proper training from a qualified and knowledeable instructor.
Our staff explored what might make the impossible turn more possible.
You can see this video and brief article here: https://www.aopa.org/news-and-media/all-news/2011/may/19/impossible-turn-practice-makes-possible