Hi,
The purpose of this fragment of code is to disable the bendpoints feature, i.e. to make it impossible to change connection’s shape. It does not transform the connections into straight lines.
@philippfromme pointed out in Disable Connection Layouting / Direct Lines - #2 by philippfromme that you need to override the BpmnLayouter’s code in order to have straight lines only.
In order to create a bpmn-js extension, you can have a look at the custom controls example.
For further assistance, please share a CodeSandbox which shows what you have achieved so far and where you are possibly stuck.