the documentation for creating a function shows [ RETURNS rettype | RETURNS TABLE ( column_name column_type [, ...] ) ] but returns is not optional. At least when specifying LANGUAGE plpgsql. All the online advice suggests specifying RETURNS void as the solution.
As with most conditionally option things in the docs reading the description for the item tells you when it can be omitted.
rettype: "When there are OUT or INOUT parameters, the RETURNS clause can be omitted."