I don’t know, seems like that leaves some loopholes, you just have to get pre-death approval ;)
> (1) Whoever unauthorizedly takes away from the custody of the entitled person the body or parts of the body of a deceased person, a dead corporeal fruit, parts of such or the ashes of a deceased person, or whoever commits insulting mischief thereon, shall be punished by imprisonment for not more than three years or a fine.
It's extremly unlikely that a judge will accept this approval and as far as I know, it has never happened. The approval could be ruled 'sittenwidrig'. Otherwise the person that approves has to be 'approvable'. There are high barriers to prove that the approval is legaly valid.
The most famous case is the 'Kannibale von Rotenburg'. Even though the victim aggreed he was sentenced to life for murder. You may find a theoretical loophole but in reality I don't think you would get away with this.
I was thinking more of the situation of a person who’ll soon die (but is mentally capable) gives permission to be eaten after their death. Sittenwidrig would be another issue, I agree.