Well, apparently I was wrong. At least about non-nullable types.
When setting the variable value to null, Activiti will look at the variable type handler associated to the current value.
So, for example, if the variable is an integer, it tries to set the value of an integer to null, which throws an exception.
It depends on what is Activiti's definition for null values, but if null value means removal from the variable map, it shouldn't get to that point. (It shouldn't call VariableInstanceEntity.setValue or even VariableMap.put at all, rather remove it from the map.)
Here's the stack trace that I got, in case it can be of any help:
Caused by: java.lang.NullPointerException
at org.activiti.engine.impl.variable.IntegerType.setValue(IntegerType.java:34)
at org.activiti.engine.impl.runtime.VariableInstanceEntity.setValue(VariableInstanceEntity.java:158)
at org.activiti.engine.impl.runtime.VariableMap.put(VariableMap.java:114)
at org.activiti.engine.impl.runtime.VariableMap.put(VariableMap.java:34)
at org.activiti.pvm.impl.runtime.ExecutionImpl.setVariableLocally(ExecutionImpl.java:593)
at org.activiti.pvm.impl.runtime.ExecutionImpl.setVariable(ExecutionImpl.java:580)
at org.activiti.pvm.impl.runtime.ExecutionImpl.setVariable(ExecutionImpl.java:584)
I would create a JIRA issue, but I don't know your intended definition for null values as variable values.