lib: More optimisation tricks for panic

Signed-off-by: Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>