Is it possible to end a program forcefully?

I think the abort function is exactly what OP is looking for. It's a library function that does essentially what the stopSketch() function posted does.