Should I use a linear function or two linear functions to grade scores?
You should focus on getting the grading correct for students who do much better than just passing, who score within the range where you would personally draw the line between who is an expert who has completely mastered the subject and who is good but needs to study a bit more to be considered to be an expert. This line is not usually at 100% because you can make minor errors even if you are an expert, it's more typically somewhere between 80% and 100%. You then want to assign some grade, say 7 to students who are at or just above that boundary, which mans that the boundary percentage should be mapped to 6.5.

The goal of teaching is to assist students who do their best and may go on to embark on an academic career, it's not about catering to students who for whatever reasons end up not doing well. The students who are not doing well risk getting into problems; if they score sufficiently low they'll not "pass the course" but it's just a total waste of efforts to figure out how to draw the line for that.

Your attitude should be that someone who scores well below, say, 85% has de-facto failed the course, but in the gray area between, say, 60% and that 85%, they are not going to be deprived of a diploma just because they didn't do well on your exam. Whether that 60% becomes 50% or 65% should not be of any concern to you. That uncertainty should make your students who are not studying hard enough worry a bit more so that they end up studying harder.