If you're laptop is plugged in you should be able to hot swap the battery. If you're worried about data loss, put your machine to sleep first, wait ~10 seconds, swap the batteries, wake it up from sleep. This is safe even if your machine loses power totally while swapping out the batteries.
OSX and Windows both support writing out your ram to disk, losing all power, then resuming from this state exactly where you left off when power is restored.
Yeah, I've done it after hibernating, but hibernating and waking up from it is like a 3-minute process for me.
It's not data loss I'm afraid of (I always save, even moreseo if I'm doing stuff that might make my computer turn off), it's like sparks and other such stuff that can happen when you're dealing with electricity.
OSX and Windows both support writing out your ram to disk, losing all power, then resuming from this state exactly where you left off when power is restored.
It's the default on OSX and may need to be enabled on Windows depending on your hardware: http://maximumpcguides.com/windows-7/turn-hybrid-sleep-on-in...