To explain why are you getting this error, let's start step by step:
1- for default value use decorator api.model, and if you have the id don't use search use browse self.env['some.model'].browse(id), but in you case you don't need this at all just do this:
student_id = fields.Many2one('res.users', 'Etudiant',
readonly=True, required=True,
default=45 )
2- onchange are also a way of setting default value but only on the view, because they are the first thing to be triggered by the client side after loading default values, onchange method are expected to return either None or a dictionary and this is why you are getting and error, AttributeError: 'int' object has no attribute 'get' because the returned value is not None so odoo is trying to get some expected values from the dictionary (like: domain, values) but oops you returned an int not a dictionary and this why Odoo throws this error.
In onchage method just set the value directly on the self record:
student_id = fields.Many2one('res.users', 'Etudiant',
readonly=True, required=True,
default=45)
@api.onchange('projet_terminer_id')
def choice_student(self):
self.student_id = self.env['res.users'].sudo().browse(45)
From the look of you code I think you can keep the onchange if you want to reset the value of student_id whenever you change projet_terminer_id field.