The straightforward answer is that stored functions always run *inside* the context of a preexisting transaction, therefore you cannot request a separate transaction from within a stored function.

What you are asking is fairly deeply impossible.